Skip to content

Commit

Permalink
Auto merge of #49809 - Mark-Simulacrum:no-color-for-dumb, r=alexcrichton
Browse files Browse the repository at this point in the history
Stop emitting color codes on TERM=dumb

These terminals generally don't support color.

Fixes #49191

cc @nikomatsakis

r? @alexcrichton
  • Loading branch information
bors committed Apr 10, 2018
2 parents 67712d7 + d326beb commit 0a7f15e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,9 @@ pub fn stream_cargo(
cargo.arg("--message-format").arg("json")
.stdout(Stdio::piped());

if stderr_isatty() && build.ci_env == CiEnv::None {
if stderr_isatty() && build.ci_env == CiEnv::None &&
// if the terminal is reported as dumb, then we don't want to enable color for rustc
env::var_os("TERM").map(|t| t != *"dumb").unwrap_or(true) {
// since we pass message-format=json to cargo, we need to tell the rustc
// wrapper to give us colored output if necessary. This is because we
// only want Cargo's JSON output, not rustcs.
Expand Down

0 comments on commit 0a7f15e

Please sign in to comment.