diff --git a/src/rustfmt_diff.rs b/src/rustfmt_diff.rs index d5129bd1bca5..23cb3f21bf2d 100644 --- a/src/rustfmt_diff.rs +++ b/src/rustfmt_diff.rs @@ -89,7 +89,9 @@ pub fn print_diff(diff: Vec, get_section_title: F) where F: Fn(u32) -> String { match term::stdout() { - Some(_) if isatty() => print_diff_fancy(diff, get_section_title, term::stdout().unwrap()), + Some(ref t) if isatty() && t.supports_color() => { + print_diff_fancy(diff, get_section_title, term::stdout().unwrap()) + } _ => print_diff_basic(diff, get_section_title), }