MCPAPI Reference

Choose documentation 3

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

LibTmux.Mcp.BoundedText

API reference · Markdown

struct LibTmux.Mcp.BoundedText
struct [source]

Terminal text cut to fit a budget, with what was cut reported.

Description#

Dropping is always from the oldest end. A terminal's newest line is the one that says what happened, so a budget that discarded it would answer the wrong question. Reporting the loss is what separates a short answer from a wrong one: a reader who cannot see that lines are missing will conclude the pane never printed them.

Members

Empty

Empty : BoundedText
propertystatic [source]

An empty result that dropped nothing.

Fit

Fit ( lines : IReadOnlyList<string> , maxLines : int? , maxBytes : int ) → BoundedText
methodstatic [source]

Cuts lines down to a line and byte budget, keeping the newest.

Parameters
  • lines ( IReadOnlyList<string> ) – The captured text, oldest first.

  • maxLines ( int? ) – The most lines to keep, or null for no line limit.

  • maxBytes ( int ) – The most UTF-8 bytes to keep.

Returns

The text that fits, and what it cost to make it fit.

ToDisplayString

ToDisplayString ( ) → string
method [source]

Renders the text as one block, noting any loss at the top.

Description#

The notice leads because a reader who sees it will read what follows as a tail rather than as the whole pane.

Returns

The lines joined by newlines, after any truncation notice.

Esc

Type to search.