Skip to main content

Module ansi_parser

Module ansi_parser 

Source
Expand description

ANSI escape sequence parser and utilities

Re-exports from vtcode-commons for backward compatibility. See docs/reference/ansi-in-vtcode.md for workspace usage guidance.

Structs§

AnsiStripStream
Stateful ANSI stripper for chunked input such as a PTY byte stream.

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
ANSI stripping for ASCII-only text.
strip_ansi_codes
Strip ANSI escape codes from text, returning a borrowed Cow when 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.