5 releases

0.10.3 Mar 12, 2024
0.10.2 Mar 7, 2024
0.10.1 Feb 25, 2024
0.10.0 Feb 24, 2024
0.9.0 Jan 28, 2024

#280 in Command-line interface

Download history 20/week @ 2024-01-27 63/week @ 2024-02-03 66/week @ 2024-02-10 85/week @ 2024-02-17 323/week @ 2024-02-24 177/week @ 2024-03-02 176/week @ 2024-03-09 60/week @ 2024-03-16 31/week @ 2024-03-23 38/week @ 2024-03-30 35/week @ 2024-04-06

181 downloads per month
Used in asciinema

Apache-2.0

615KB
4K 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.

Therefore avt is small and focused but a full-fledged terminal emulator can't be built with it.

avt doesn't try to replicate a specific terminal variant like VT102 or VT220, however it implements most control sequences found in modern terminal emulators like xterm, Gnome Terminal, 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