There have been a couple of attempts at this in the past, which had some usability warts in what I recall as an earlier, less useful set of features overall. Whether that was collective misunderstanding at the time, or things have gotten better since then, now is a good time to adopt the workspace dep syntax, because wezterm has many crates to keep on top of, and automation like dependabot can't see a lot of them. This will help to manage the versions of deps in wezterm centrally. Let's try this out in CI: the Cargo.lock changes here are minimal (eliminated a second version of base64 from one crate, terminal_size from another, and removed an explicit dep on serde_derive) so hopefully this sails through on !linux. closes: https://github.com/wezterm/wezterm/pull/6668
vtparse
This is an implementation of a parser for escape and control sequences. It is based on the DEC ANSI Parser.
It has been modified slightly to support UTF-8 sequences.
vtparse is the lowest level parser; it categorizes the basic
types of sequences but does not ascribe any semantic meaning
to them.
You may wish to look at termwiz::escape::parser::Parser in the
termwiz crate if you're looking for semantic
parsing.
Comparison with the vte crate
vtparse has support for dynamically sized OSC buffers, which makes
it suitable for processing large escape sequences, such as those
used by the iTerm2 image protocol.