ANSI escape sequence state machine for parsing CSI and OSC sequences.
Shared logic for visible_width and truncate operations.
Instance methods
Processes a character and updates state. Returns true if the character
is part of an escape sequence (should be skipped/kept but not counted).
Source