Skip to content

Commit 02d6461

Browse files
committed
Enable or disable colored output according to CLICOLOR(_FORCE)
1 parent 5253294 commit 02d6461

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libsyntax/errors/emitter.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ impl ColorConfig {
5555
match *self {
5656
ColorConfig::Always => true,
5757
ColorConfig::Never => false,
58-
ColorConfig::Auto => stderr_isatty(),
58+
ColorConfig::Auto => env::var("CLICOLOR_FORCE").unwrap_or("0".to_string()) != "0" ||
59+
(stderr_isatty() && env::var("CLICOLOR").unwrap_or("1".to_string()) != "0"),
5960
}
6061
}
6162
}

0 commit comments

Comments
 (0)