Skip to content

georgiyozhegov/ruterm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruterm

Tiny (~400 loc) library for working with the terminal

docs.rs crates.io GitHub License GitHub code size in bytes

Examples

Usage

use ruterm::{
    error::Result,
    in_raw,
    view::{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)?; // green foreground
        write("Hello from raw mode!\n\r")?;
        write(RESET)?; // reset style
        cursor::set(0, h)?; // move cursor to the bottom
    });

    Ok(())
}

Installation

From crates.io:

cargo add ruterm

From repository (more recent):

cargo add --git https://github.com/georgiyozhegov/ruterm.git

Warning: Currently, supports only Linux.

References

About

Tiny library for working with the terminal.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages