LibTmux.Mcp.BoundedText
.NET
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust Unavailable
- Go Unavailable
- Java Unavailable
- .NET
- C++ Unavailable
- Swift Unavailable
-
Terminal text cut to fit a budget, with what was cut reported.
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 : BoundedText
-
An empty result that dropped nothing.
- Fit ( lines : IReadOnlyList<string> , maxLines : int? , maxBytes : int ) BoundedText
-
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.
-
Renders the text as one block, noting any loss at the top.
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.