Auto disable colored output for unsupported Windows shells

This commit is contained in:
J.W 2017-10-20 15:15:32 +08:00 committed by David Peter
parent 6a01faf6e1
commit ce73c086b6
2 changed files with 3 additions and 1 deletions

View File

@ -31,7 +31,7 @@ repository = "sharkdp/fd"
clap = "2.26.0"
[dependencies]
ansi_term = "0.9"
ansi_term = "0.10"
atty = "0.2"
clap = "2.26.0"
ignore = "0.2"

View File

@ -79,6 +79,8 @@ fn main() {
Some("never") => false,
_ => atty::is(Stream::Stdout),
};
#[cfg(windows)]
let colored_output = colored_output && ansi_term::enable_ansi_support().is_ok();
let ls_colors = if colored_output {
Some(