TUI::Term
Constants
Box-drawing characters. Corners are rounded (matching lazygit's border style); T-junctions/cross stay square, which is standard even in rounded-corner box styles (there's no rounded T-junction glyph).
Class methods
Concatenates the SGR codes for every attribute set on style, then
applies them all at once and resets at the end — the composable
counterpart to #bold/#dim/#reverse/#fg/#bg, which each only ever
apply one attribute and previously had to be manually nested to
combine (e.g. Term.fg(:red, Term.bold(s))). A default Style.new
(every field false/nil) is a no-op: returns s unchanged.
Composes one horizontal border row: left + N segments of fill
repeated to each width, joined by junction, + right. Segment
widths are the caller's raw inner width per span — callers add
their own padding conventions (e.g. markdown table cells add 2 for
the space around cell text; Buffer's box/hline segments don't).
Style-agnostic by design: callers either pre-apply style to the
glyph args (Buffer) or wrap the plain result afterward (Markdown's
InlineRun), so no Style parameter is added here.
Bracketed paste mode (mode 2004): the terminal wraps a pasted block
in \e[200~/\e[201~ markers instead of sending it as ordinary
keystrokes, so Keys.parse_bracketed_paste can recognize it as one
paste operation. This is the only paste-related signal a terminal
app can actually receive — there's no way to intercept a native
clipboard shortcut (e.g. Cmd-V) itself, since the terminal emulator
handles that before the app ever sees any bytes.
SGR extended mouse reporting (mode 1000 reports button/wheel events, mode 1006 switches to the SGR encoding Keys.parse_sgr_mouse expects — plain mode 1000 alone caps coordinates at 223 and uses a different, ambiguous byte encoding).
The full escape sequence for style (e.g. "\e[1;31m"), or "" for a
no-op default Style.new — for #overlay, which injects a complete
escape sequence after every existing one in a string rather than
wrapping start/end like #apply does.
Pad or truncate to exactly width visible columns. align
controls where padding goes when the string is shorter than
width — a string needing truncation ignores it (there's no room
for padding either way).
Layers an extra SGR code (e.g. REVERSE or BOLD) on top of
whatever styling s already carries, rather than replacing it —
used to highlight a row (cursor/selection) without discarding its
cells' own colors. Unlike #bold/#dim/#reverse, this never strips
existing codes and never appends a trailing reset, so Buffer#set's
per-cell style accumulation picks up both the original color and
the overlay for the same cell.
The bare SGR code string for style, with no wrapping \e[/m/
RESET — the numeric parameters only, e.g. "1;31". Combine with
#escape (or use #apply/#overlay directly) to get an actual escape
sequence a terminal understands.
Strip all ANSI escape sequences, returning plain visible text.
Truncate string to width visible columns, appending "…" if cut.
Preserves embedded ANSI codes up to the cut point (rather than
stripping them) so a styled string that needs truncating doesn't
lose its color/style — only the characters past width are
dropped, exactly like the untruncated case already does.