Termion is a pure Rust, bindless library for low-level handling, manipulating and reading information about terminals. This provides a full-featured alternative to Termbox.
Termion aims to be simple and yet expressive. It is bindless, meaning that it is not a front-end to some other library (e.g., ncurses or termbox), but a standalone library directly talking to the TTY.
Termion is quite convenient, due to its complete coverage of essential TTY features, providing one consistent API. Termion is rather low-level containing only abstraction aligned with what actually happens behind the scenes. For something more high-level, refer to inquirer-rs, which uses Termion as backend.
Termion generates escapes and API calls for the user. This makes it a whole lot cleaner to use escapes.
Supports Redox, Mac OS X, BSD, and Linux (or, in general, ANSI terminals).
A note on stability
This crate is stable.
 = "*"
0.1.0 to 1.0.0 guide
This sample table gives an idea of how to go about converting to the new major version of Termion.
- Raw mode.
- 256-color mode.
- Cursor movement.
- Text formatting.
- Console size.
- TTY-only stream.
- Control sequences.
- Termios control.
- Password input.
- Redox support.
- Panic-free error handling.
- Special keys events (modifiers, special keys, etc.).
- Asynchronous key events.
- Mouse input.
- Carefully tested.
- Detailed documentation on every item.
and much more.
Style and colors.
extern crate termion; use ; use io;
Moving the cursor
extern crate termion;
extern crate termion; use ; use ; use IntoRawMode; use ;
Read a password
extern crate termion; use TermRead; use ;
examples/, and the documentation, which can be rendered using
For a more complete example, see a minesweeper implementation, that I made for Redox using termion.