Expand description
ANSI escape sequence parser and utilities
Re-exports from vtcode-commons for consistent behavior with vtcode-core.
See docs/reference/ansi-in-vtcode.md for workspace usage guidance.
Functions§
- contains_
unicode - Detect if text contains unicode characters that need special handling
- parse_
ansi_ sequence - Parse and determine the length of the ANSI escape sequence at the start of text
- strip_
ansi - Strip ANSI escape codes from text, keeping only plain text
- strip_
ansi_ ascii_ only - Fast ASCII-only ANSI stripping for performance-critical paths
- strip_
ansi_ bytes - Strip ANSI escape codes from arbitrary bytes, preserving non-control bytes.
- strip_
ansi_ codes - Strip ANSI escape codes from text, returning a borrowed
Cowwhen the input contains no ESC byte. This is the preferred API for call-sites that want to avoid allocation on the common “no ANSI codes” path.