19 unstable releases

0.10.1 Apr 17, 2021
0.10.0 Jan 3, 2021
0.9.0 Nov 13, 2020
0.8.0 May 13, 2020
0.1.2 Sep 19, 2016

#16 in Parser implementations

Download history 21343/week @ 2021-01-12 19990/week @ 2021-01-19 20227/week @ 2021-01-26 20590/week @ 2021-02-02 21542/week @ 2021-02-09 23329/week @ 2021-02-16 20774/week @ 2021-02-23 22262/week @ 2021-03-02 29579/week @ 2021-03-09 32680/week @ 2021-03-16 27676/week @ 2021-03-23 28464/week @ 2021-03-30 28982/week @ 2021-04-06 31658/week @ 2021-04-13 37046/week @ 2021-04-20 25061/week @ 2021-04-27

107,168 downloads per month
Used in 142 crates (21 directly)

Apache-2.0 OR MIT

47KB
1K SLoC

vte

Build Status Crates.io Version

Parser for implementing virtual terminal emulators in Rust.

The parser is implemented according to Paul Williams' ANSI parser state machine. The state machine doesn't assign meaning to the parsed data and is thus not itself sufficient for writing a terminal emulator. Instead, it is expected that an implementation of the Perform trait which does something useful with the parsed data. The Parser handles the book keeping, and the Perform gets to simply handle actions.

See the docs for more info.


lib.rs:

Parser for implementing virtual terminal emulators

Parser is implemented according to Paul Williams' ANSI parser state machine. The state machine doesn't assign meaning to the parsed data and is thus not itself sufficient for writing a terminal emulator. Instead, it is expected that an implementation of Perform is provided which does something useful with the parsed data. The Parser handles the book keeping, and the Perform gets to simply handle actions.

Examples

For an example of using the Parser please see the examples folder. The example included there simply logs all the actions Perform does. One quick thing to see it in action is to pipe vim into it

cargo build --release --example parselog
vim | target/release/examples/parselog

Just type :q to exit.

Differences from original state machine description

  • UTF-8 Support for Input
  • OSC Strings can be terminated by 0x07
  • Only supports 7-bit codes. Some 8-bit codes are still supported, but they no longer work in all states.

Dependencies

~145KB