Merge pull request #1142 from kamalmarhubi/fix-1140
Check term supports colour before printing fancy diffs
This commit is contained in:
commit
35624c54e5
1 changed files with 3 additions and 1 deletions
|
|
@ -89,7 +89,9 @@ pub fn print_diff<F>(diff: Vec<Mismatch>, 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),
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue