9 releases (4 breaking)

0.14.0 Oct 14, 2024
0.13.0 Oct 4, 2024
0.11.1 Jun 20, 2024
0.10.3 Mar 12, 2024
0.9.0 Jan 28, 2024

#402 in Text processing

Download history 136/week @ 2024-08-17 57/week @ 2024-08-24 65/week @ 2024-08-31 108/week @ 2024-09-07 67/week @ 2024-09-14 108/week @ 2024-09-21 176/week @ 2024-09-28 204/week @ 2024-10-05 377/week @ 2024-10-12 327/week @ 2024-10-19 202/week @ 2024-10-26 213/week @ 2024-11-02 163/week @ 2024-11-09 195/week @ 2024-11-16 164/week @ 2024-11-23 165/week @ 2024-11-30

708 downloads per month
Used in asciinema

Apache-2.0

620KB
4.5K SLoC

avt - asciinema virtual terminal

avt is asciinema's implementation of virtual terminal emulator written in Rust.

It is used by asciinema CLI, asciinema player, asciinema server and asciinema gif generator.

This implementation covers only parsing and virtual buffer related aspects of a terminal emulator as it's all asciinema needs.

avt consists of:

  • parser for ANSI-compatible video terminal based on excellent state diagram by Paul Williams,
  • virtual screen buffers (primary/alternate) in a form of character grid with additional color/styling attributes,
  • API for feeding text into the parser and for querying virtual screen buffer and cursor position.

Following aspects of terminal emulation are not in scope of this project:

  • input handling,
  • rendering.

While avt is small and focused, a full-fledged terminal emulator could potentially be built on top of it.

avt doesn't try to 100% replicate any specific terminal variant like VT102 or VT520, instead it implements most control sequences supported by modern terminal emulators like xterm, Gnome Terminal, WezTerm, Alacritty, iTerm, mosh etc.

License

© 2019 Marcin Kulik.

All code is licensed under the Apache License, Version 2.0. See LICENSE file for details.

Dependencies