Full VT100/xterm Emulation
Every escape sequence. Every color mode. Every weird edge case from 1978. Handled.
Questions this answers
- Terminal not rendering colors correctly in tmux or Vim
- Which terminal emulators support true color 24-bit on macOS?
- xterm escape sequences not working in my terminal
- How to check if my terminal supports 256 colors
- Terminal emulator compatibility with ncurses applications
How it works
Chau7 implements the full VT100, VT220, and xterm control sequence specification. This includes CSI sequences for cursor movement, screen manipulation, and character attributes; OSC sequences for window titles, color palette changes, and clipboard access; DCS sequences for DECRQSS and Sixel graphics; and all standard mode settings (DECCKM, DECAWM, DECOM, and dozens more).
Color support spans the complete range: the original 8 ANSI colors, 16-color extended palette, 256-color indexed palette (SGR 38;5;n), and full 24-bit true color (SGR 38;2;r;g;b). The terminal correctly advertises its capabilities via the TERM environment variable and responds to DA (Device Attributes) queries so that applications like Vim, tmux, and htop automatically detect and use the best available color mode.
Emulation accuracy is validated against a suite of terminal conformance tests, including vttest, esctest, and a custom test harness that verifies behavior against xterm's reference implementation. Edge cases like origin mode interaction with scroll regions, character set switching (G0/G1/G2/G3), and protected area support are all handled correctly.
Why it matters
Terminal emulation bugs manifest as garbled output, broken TUI layouts, and applications that refuse to run. Chau7 implements VT100 and xterm escape sequences comprehensively, including 256-color, true color (24-bit), and all standard control sequences. If it works in xterm, it works in Chau7.
Frequently asked questions
What TERM value does Chau7 set?
Chau7 sets TERM=xterm-256color by default, which provides broad compatibility with existing terminfo databases. A custom Chau7 terminfo entry is also available for applications that want to query advanced capabilities like true color and Sixel support.
Does Chau7 support the Kitty keyboard protocol?
Yes. Chau7 implements the progressive enhancement keyboard protocol (CSI u) that Kitty popularized, allowing applications to distinguish key-down, key-up, and repeat events with full modifier information.
How does Chau7 handle broken escape sequences from misbehaving programs?
The parser uses a timeout-based recovery mechanism. If an escape sequence is incomplete after a configurable timeout (default 100ms), the parser treats the ESC byte as a literal character and resumes normal parsing. This prevents a single malformed sequence from corrupting the rest of the output stream.