summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave L <dave@lemonby.com>2023-03-24 19:14:32 +1100
committerGitHub <noreply@github.com>2023-03-24 09:14:32 +0100
commit2f8802a412fb7ce888c34823a5f39f083909a9cc (patch)
tree0edd2ca31f55c0be5451f4257e0af35579cb319f
parente927486970f69a3647ab222e47eabda84075af06 (diff)
Changed "ColorChoice::Always" to "ColorChoice::Auto" to honour user setting of TERM / NO_COLOR (#230)
-rw-r--r--cli/src/main.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/src/main.rs b/cli/src/main.rs
index e978d35d..2e269bda 100644
--- a/cli/src/main.rs
+++ b/cli/src/main.rs
@@ -162,7 +162,7 @@ fn print_version() -> ! {
/// Print an application-level error (independent from a source file).
fn print_error(msg: &str) -> io::Result<()> {
- let mut w = StandardStream::stderr(ColorChoice::Always);
+ let mut w = StandardStream::stderr(ColorChoice::Auto);
let styles = term::Styles::default();
w.set_color(&styles.header_error)?;
@@ -277,7 +277,7 @@ fn status(command: &CompileCommand, status: Status) -> io::Result<()> {
let message = status.message();
let color = status.color();
- let mut w = StandardStream::stderr(ColorChoice::Always);
+ let mut w = StandardStream::stderr(ColorChoice::Auto);
write!(w, "{esc}c{esc}[1;1H")?;
w.set_color(&color)?;
@@ -327,7 +327,7 @@ fn print_diagnostics(
world: &SystemWorld,
errors: Vec<SourceError>,
) -> Result<(), codespan_reporting::files::Error> {
- let mut w = StandardStream::stderr(ColorChoice::Always);
+ let mut w = StandardStream::stderr(ColorChoice::Auto);
let config = term::Config { tab_width: 2, ..Default::default() };
for error in errors {