Newer
Older
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.
Supports Redox, Mac OS X, and Linux (or, in general, ANSI terminals).
[Documentation.](http://ticki.github.io/termion/) | [Examples.](https://github.com/Ticki/termion/tree/master/examples)
Although small breaking changes might happen, I will try my best to avoid them,
and this crate can generally be considered stable.
## Cargo.toml
For nightly, add
```toml
[dependencies.termion]
```
For stable,
```toml
[dependencies.termion]
ticki
committed
- Truecolor.
- Text formatting.
- Console size.
- Control sequences.
- Termios control.
- Password input.
## Example
```rust
extern crate termion;
ticki
committed
use termion::{color, style};
ticki
committed
println!("{}Red", color::Fg(color::Red));
ticki
committed
println!("{}Blue", color::Fg(color::Blue));
ticki
committed
println!("{}Blue'n'Bold{}", style::Bold, style::Reset);
ticki
committed
println!("{}Just plain italic", style::Italic);
See `examples/`, and the documentation, which can be rendered using `cargo doc`.
For a more complete example, see [a minesweeper implementation](https://github.com/redox-os/games-for-redox/blob/master/src/minesweeper/main.rs), that I made for Redox using termion.