Documentation
¶
Overview ¶
Package termtext cleans raw process output — captured from a PTY, so full of terminal control sequences — for display. The TUI keeps colour and strips only what would corrupt its layout (StripUnsafe); an agent reading logs wants plain text with no escape sequences at all (Plain).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Plain ¶
Plain reduces a line to printable text: every escape sequence goes (StripUnsafe then StripANSI), and so does any C0 control byte left behind — a lone ESC from a sequence cut off mid-line, a bell, a backspace. What remains is safe to hand to an agent or a JSON consumer as-is.
func StripANSI ¶
StripANSI removes CSI sequences of the simple "ESC [ digits ; letter" shape — in practice, SGR colour codes.
func StripUnsafe ¶
StripUnsafe removes every control sequence except SGR colour codes, and expands tabs.
Types ¶
This section is empty.