Crates.io | ruterm |
lib.rs | ruterm |
version | 0.3.2 |
source | src |
created_at | 2024-04-21 13:10:19.300124 |
updated_at | 2024-07-16 15:18:06.571731 |
description | Tiny library for working with the terminal |
homepage | |
repository | https://github.com/georgiyozhegov/terminal |
max_upload_size | |
id | 1215353 |
size | 28,372 |
use ruterm::{
error::Result,
in_raw,
view::{color::fore, RESET},
tio::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)?; // green foreground
write("Hello from raw mode!\n\r")?;
write(RESET)?; // reset style
cursor::set(0, h)?; // move cursor to the bottom
});
Ok(())
}
From crates.io:
cargo add ruterm
From repository (more recent):
cargo add --git https://github.com/georgiyozhegov/ruterm.git
Warning: Currently, supports only Linux.