#ansi #codes #terminal #tty #vt100

ansi-escapes

Ansi escape codes for manipulating the terminal

2 releases

Uses old Rust 2015

0.1.1 Aug 6, 2021
0.1.0 Nov 1, 2016

#432 in Command-line interface

Download history 912/week @ 2023-02-10 1858/week @ 2023-02-17 2426/week @ 2023-02-24 2801/week @ 2023-03-03 2994/week @ 2023-03-10 2534/week @ 2023-03-17 2425/week @ 2023-03-24 1072/week @ 2023-03-31 1081/week @ 2023-04-07 1472/week @ 2023-04-14 1617/week @ 2023-04-21 2134/week @ 2023-04-28 2221/week @ 2023-05-05 2006/week @ 2023-05-12 2000/week @ 2023-05-19 2302/week @ 2023-05-26

9,065 downloads per month
Used in 17 crates (10 directly)

MIT license

9KB
142 lines

ANSI Escapes

ANSI escape codes for manipulating the terminal

Usage

This example program will print "Hello, World!", then replace it with "Hello, Terminal!" after one second.

extern crate ansi_escapes;

use std::thread::sleep;
use std::time::Duration;

fn main() {
    // Hides the cursor
    print!("{}", ansi_escapes::CursorHide);

    // Prints first message
    println!("Hello, World!");

    // Waits one seconds
    sleep(Duration::from_secs(1));

    // Erases the two lines
    print!("{}", ansi_escapes::EraseLines(2));

    // Print final message
    println!("Hello, Terminal!");

    // Shows the cursor
    print!("{}", ansi_escapes::CursorShow);
}

API

See documentation

No runtime deps