enable ansi terminal on windows 10 cmd

This commit is contained in:
2022-03-28 22:29:45 +02:00
parent 7197c11586
commit 6c064a1dd8
3 changed files with 6 additions and 1 deletions

1
Cargo.lock generated
View File

@@ -2332,6 +2332,7 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
name = "uw8" name = "uw8"
version = "0.1.2" version = "0.1.2"
dependencies = [ dependencies = [
"ansi_term",
"anyhow", "anyhow",
"curlywas", "curlywas",
"minifb", "minifb",

View File

@@ -24,3 +24,4 @@ warp = { version = "0.3.2", optional = true }
tokio = { version = "1.17.0", features = ["sync", "rt"], optional = true } tokio = { version = "1.17.0", features = ["sync", "rt"], optional = true }
tokio-stream = { version = "0.1.8", features = ["sync"], optional = true } tokio-stream = { version = "0.1.8", features = ["sync"], optional = true }
webbrowser = { version = "0.6.0", optional = true } webbrowser = { version = "0.6.0", optional = true }
ansi_term = "0.12.1"

View File

@@ -15,6 +15,9 @@ use uw8::Runtime;
fn main() -> Result<()> { fn main() -> Result<()> {
let mut args = Arguments::from_env(); let mut args = Arguments::from_env();
// try to enable ansi support in win10 cmd shell
let _ = ansi_term::enable_ansi_support();
match args.subcommand()?.as_deref() { match args.subcommand()?.as_deref() {
Some("version") => { Some("version") => {
println!("{}", env!("CARGO_PKG_VERSION")); println!("{}", env!("CARGO_PKG_VERSION"));