Skip to content

Commit

Permalink
Auto disable colored output for unsupported Windows shells
Browse files Browse the repository at this point in the history
  • Loading branch information
J.W authored and sharkdp committed Oct 20, 2017
1 parent 6a01faf commit ce73c08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ce73c08

Please sign in to comment.