2 releases
new 0.2.3 | Apr 28, 2024 |
---|---|
0.2.2 | Apr 21, 2024 |
0.2.1 |
|
0.2.0 |
|
#212 in Command-line interface
315 downloads per month
17KB
300 lines
Installation
cargo add ruterm # from crates.io
cargo add --git https://github.com/georgiyozhegov/terminal.git # more recent version
Usage
use ruterm::{
error::Result,
in_raw,
style::{color::fore, RESET},
io::write,
size,
cursor,
};
fn main() -> Result<()> {
in_raw!({
cursor::start()?; // clear screen
let (w, h) = size()?;
cursor::set(w / 2, h / 2)?; // move cursor to the center
write(fore::GREEN.as_bytes())?; // green foreground
write(b"Hello from raw mode!\n\r")?;
write(RESET.as_bytes())?; // reset style
cursor::set(0, h)?; // move cursor to the bottom
});
Ok(())
}
Examples
cargo run --example car
Dependencies
~120KB