#ansi #ansi-codes #terminal #codes #tty #vt100

no-std ansi-escapes

Ansi escape codes for manipulating the terminal

3 unstable releases

0.2.0 Jun 23, 2024
0.1.1 Aug 6, 2021
0.1.0 Nov 1, 2016

#92 in Command-line interface

Download history 3498/week @ 2024-03-14 3240/week @ 2024-03-21 3098/week @ 2024-03-28 2981/week @ 2024-04-04 3053/week @ 2024-04-11 3501/week @ 2024-04-18 3920/week @ 2024-04-25 2649/week @ 2024-05-02 3206/week @ 2024-05-09 3365/week @ 2024-05-16 3593/week @ 2024-05-23 3419/week @ 2024-05-30 3651/week @ 2024-06-06 4910/week @ 2024-06-13 5073/week @ 2024-06-20 3576/week @ 2024-06-27

17,800 downloads per month
Used in 20 crates (12 directly)

MIT license

10KB
141 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