| crate | purpose |
|---|---|
vtty |
the parser (re-exports vtty_core) |
vtty_core |
terminal model types + Perform |
vtty_codec |
no_std binary Encode/Decode codec for vtty_core |
vtty_width |
display cell width + emoji sequences |
vtty_grapheme |
UAX #29 grapheme cluster segmentation |
vtty_status |
OSC 7501 Program Status Protocol |
vtty_screen |
cell-grid terminal screen |
vtty_ffi |
raw C ABI |
vtty_bench |
throughput benchmarks |
- Safety:
#![forbid(unsafe_code)], nounwrap/expect/panic. - Zero-allocation: bulk
print_bytes/print_codepoints. no_std: optionalsimd/simd-transcodefeatures.- UTF-8: maximal-subpart substitution; 8-bit C1 controls.
- Serialization: compact,
no_std, zero-allocationEncode/Decodecodec (vtty_codec) for events, replies, and terminal state.
cargo add vttyuse vtty::{Parser, Perform};
struct Screen;
impl Perform for Screen {
fn print_bytes(&mut self, _s: &[u8]) { /* printable ASCII run */ }
fn print(&mut self, _c: char) { /* non-ASCII code point */ }
fn execute(&mut self, _b: u8) { /* \n \t \x1b … */ }
fn csi_dispatch(&mut self, _params: &[i32], _sep: u16, _intermediates: &[u8], _final_byte: u8) {
/* CSI Ps ; Ps final */
}
fn osc_dispatch(&mut self, _params: &[&[u8]], _bell: bool) { /* OSC */ }
}
let mut screen = Screen;
let mut parser = Parser::new();
parser.advance(&mut screen, b"\x1b[1;31mhello\x1b[0m");Owned events, replies and terminal state round-trip through a compact, no_std binary codec:
use vtty_codec::{decode_from_slice, encode_to_vec};
use vtty::{Event, Parser};
let mut parser = Parser::new();
let events = parser.parse_events(b"\x1b[1;31mhi");
let bytes = encode_to_vec(&events)?;
assert_eq!(decode_from_slice::<Vec<Event>>(&bytes)?, events);Throughput vs vte/vt100/vtparse/rio-vt; see vtty_bench for the full table.
ARCHITECTURE.md: parser design and layout.CONFORMANCE.md: escape-sequence conformance notes.CHANGELOG.md: release history.
cargo test --workspace
cargo test -p vtty --test vt_differential -- --nocapture # parity vs vte
cargo test -p vtty --test vt_differential_rio -- --nocapture # parity vs rio-vtLicensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.