You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Phuntsok Drak-pa cb9aa04812 Added example 3 years ago
examples Added example 3 years ago
src Added tests and documentation 3 years ago
.gitignore initial commit 3 years ago
Cargo.toml Added tests and documentation 3 years ago
LICENSE Add LICENSE 3 years ago
README.md Updated readme with badges 3 years ago
appveyor.yml Fix for AppVeyor config 3 years ago

README.md

crates.io GPL-3.0 Licensed Downloads Released API docs AppVeyor CI

Output-VT100

This simple crates allows developers to enable ANSI escape characters in Windows' console, be it CMD or PowerShell. Its usage is very simple, as shown below:

extern crate output_vt100;

fn main() {
    output_vt100::init();
    println!("\x1b[31mThis text is red!\x1b[0m");
}

If you wish to ensure the output_vt100::init() function is only ran once, you can use the crate ctor. Be aware though it might not be suited for every use case, as explained on the crate’s presentation.

extern crate output_vt100;
extern crate ctor;
use ctor::*;

#[ctor]
fn init_term() {
    output_vt100::init();
}

fn main() {
    println!("\x1b[31mThis text is red!\x1b[0m");
}

Acknowledgements

A big thank you to nbouteme who helped me a lot during the development of this create.