![](https://private-user-images.githubusercontent.com/159022025/333574008-0575c990-7527-41ca-9068-eb88f4f27825.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyODQ5NTMsIm5iZiI6MTcyNDI4NDY1MywicGF0aCI6Ii8xNTkwMjIwMjUvMzMzNTc0MDA4LTA1NzVjOTkwLTc1MjctNDFjYS05MDY4LWViODhmNGYyNzgyNS5naWY_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMVQyMzU3MzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xYzEwYjJiMzY5MzAwOTZmOGExZWFiODQ0ODQyOTVlZDEyNjM0ODNiODQzZmE2NDQ2ZWNkZjA4ODIxMzliNmY2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.8vABBONCITZycFZ8bsuu7ZwVMJJgZQcdf4V3zco46_k)
![](https://private-user-images.githubusercontent.com/159022025/333714244-93541f66-fb79-41ee-b564-8aaac6316564.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyODQ5NTMsIm5iZiI6MTcyNDI4NDY1MywicGF0aCI6Ii8xNTkwMjIwMjUvMzMzNzE0MjQ0LTkzNTQxZjY2LWZiNzktNDFlZS1iNTY0LThhYWFjNjMxNjU2NC5naWY_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODIxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyMVQyMzU3MzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kNmIxMWEwYWZlNzc0ZWU3N2U5MzM5ZjcxN2MyNjNlODc1ZmQ3MzA4NDVkNjdjODg0NTc1OGQyZTQyMzFjZTJmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.QjgmFrTDelHgl3abDOaXF5vp2AezB5kE2yTX97Jphuw)
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.