MCPconceptAPI reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

Concept example A working example of the core library. It can change without notice. What concept means

LibTmux.Mcp.BoundedText

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.

Parameters
  • Lines (IReadOnlyList<string>) – The text that fits, oldest first.

  • Truncated (bool) – Whether anything was dropped to make it fit.

  • DroppedLines (int) – How many complete lines were dropped from the start.

  • DroppedBytes (int) – The exact number of UTF-8 bytes of PANE TEXT dropped from the start. This is not the unit the byte budget is spent in: that bounds the whole serialized result, where the same text is escaped as JSON and carried twice, so for wide characters it can be several times larger than the number here.

Properties4

BoundedText properties
NameTypeDescription
Lines IReadOnlyList<string> The text that fits, oldest first.
Truncated bool Whether anything was dropped to make it fit.
DroppedLines int How many complete lines were dropped from the start.
DroppedBytes int The exact number of UTF-8 bytes of PANE TEXT dropped from the start. This is not the unit the byte budget is spent in: that bounds the whole serialized result, where the same text is escaped as JSON and carried twice, so for wide characters it can be several times larger than the number here.

Other members3 members

  • Empty: BoundedText property An empty result that dropped nothing.
  • Fit method Cuts lines down to a line and byte budget, keeping the newest.
  • ToDisplayString method Renders the text as one block, noting any loss at the top.
Esc
Search in

Type to search.

Reference previewOpen reference