]> git.lizzy.rs Git - rust.git/commit
print_diff: Don't print color codes if output is not a tty
authorKamal Marhubi <kamal@marhubi.com>
Tue, 31 May 2016 13:15:33 +0000 (15:15 +0200)
committerKamal Marhubi <kamal@marhubi.com>
Tue, 31 May 2016 13:15:33 +0000 (15:15 +0200)
commit9759068e6280c8958d8ef769337d015794fb605f
tree85f9fe88e50199cb784021290b9408092f71aac9
parent240dba54677c09a455d15f76f8d4f328348ebd99
print_diff: Don't print color codes if output is not a tty

On unix, `term::stdout()` just reads the `TERM` environment variable to
decide what features are available. It does not check if the output file
descriptor is in fact a tty. This resulted in printing escape codes when
redirecting output.
Cargo.lock
Cargo.toml
src/rustfmt_diff.rs