Skip to main content

Module text

Module text 

Source
Expand description

Output text handling shared by the blocking bash and shell jobs, ported from utils/ansi.ts (stripAnsi), utils/shell.ts (sanitizeBinaryOutput), core/tools/truncate.ts (truncateTail) and the streaming TextDecoder.

Structs§

Decoder
Streaming UTF-8 decoder with WHATWG replacement (one U+FFFD per maximal invalid subpart).

Constants§

DEFAULT_MAX_BYTES
DEFAULT_MAX_LINES

Functions§

clean
Chunk text as both TS paths write it: sanitizeBinaryOutput(stripAnsi(text)).replace(/\r/g, "").
strip_ansi
tail_bytes
The last max bytes of text, starting at a character boundary.
truncate_tail
truncateTail with the default limits: the last lines that fit, else the end of the last line. None when the text fits.