44 releases

0.12.0 Sep 9, 2023
0.2.2 Nov 23, 2024
0.1.17 Oct 6, 2024
0.1.3 Jul 27, 2024
0.0.28 Nov 29, 2023

#518 in Command-line interface

Download history 205/week @ 2024-08-03 160/week @ 2024-08-10 242/week @ 2024-08-17 230/week @ 2024-08-24 130/week @ 2024-08-31 271/week @ 2024-09-07 341/week @ 2024-09-14 563/week @ 2024-09-21 325/week @ 2024-09-28 431/week @ 2024-10-05 326/week @ 2024-10-12 215/week @ 2024-10-19 238/week @ 2024-10-26 94/week @ 2024-11-02 149/week @ 2024-11-09 173/week @ 2024-11-16

679 downloads per month
Used in 2 crates

Apache-2.0 OR MIT

61KB
1.5K SLoC

Copa

Copa is a fork of Alacritty's VTE intended to extend Paul Williams' ANSI parser state machine with custom instructions.

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 ansicode.txt 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

~96KB