Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeControls ¶
EscapeControls renders control characters visibly instead of executing or deleting them. Use it where the exact untrusted value is security-relevant, such as a shell command awaiting approval or a file path in a diff header.
func EscapeControlsPreserveLayout ¶
EscapeControlsPreserveLayout escapes controls but retains newlines and tabs. It is intended for structured multi-line text such as diff content.
func Sanitize ¶
Sanitize removes terminal control sequences from untrusted display text while preserving its printable text, tabs, and line structure. Trusted TUI styling should be applied only after this boundary.
func SanitizeBytes ¶ added in v0.0.400
SanitizeBytes is the byte-slice form of Sanitize. It returns the original slice when no sanitization is needed, avoiding copies in rendering hot paths.
func SanitizeSingleLine ¶
SanitizeSingleLine removes terminal controls and flattens vertical or tabular whitespace so metadata cannot create convincing extra TUI rows.
Types ¶
This section is empty.