vtty
Zero-allocation, panic-free DEC VT500 terminal parser with UTF-8 decoding
and no_std support.
Usage
use ;
;
let mut parser = new;
parser.advance;
// With the `simd-transcode` feature enabled, opt into SIMD scanning,
// validation and UTF-8→UTF-32 transcode:
let mut parser = with_simd;
parser.advance;
Also available: Event/Recording (owned enum API), State (byte-cursor
sink with line/cursor geometry), Reply (query reply builder), and
ColorId, SgrFlags, TermFlags, KittyFlags, MouseButton, Charset, Cap.
Design
- Panic-free —
#![forbid(unsafe_code)]; malformed PTY input never crashes. - Zero-allocation hot path — one
print_bytesper ASCII run, oneprint_codepointsper non-ASCII run; CSI/OSC/DCS state is inline. no_stdby default — optionalsimd(scanning + validation) andsimd-transcode(UTF-8→UTF-32) features, enabled per parser.- W3C-correct UTF-8 — maximal-subpart substitution; 8-bit clean (DEC “anywhere”).
Test