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.
Lucien Cartier-Tilet d756f84269
continuous-integration/drone/push Build is passing Details
Update README to reflect change in source code
10 months ago
examples Added example 4 years ago
src Custom Error type, as per clippy’s wishes 10 months ago
.drone.yml Replace Gitlab CI with Drone 10 months ago
.gitignore initial commit 4 years ago
Cargo.toml New release for new license 2 years ago
LICENSE Change license to MIT 4 years ago
README.md Update README to reflect change in source code 10 months ago
appveyor.yml Fix for AppVeyor config 4 years ago

README.md

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

crates.io Released API docs Downloads MIT Licensed AppVeyor CI Build Status

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 crates 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");
}

Not that init panics on error, if you do not wish to panic, use output_vt100::try_init which returns a Result<(), InitError>

Acknowledgements

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