From 2f8802a412fb7ce888c34823a5f39f083909a9cc Mon Sep 17 00:00:00 2001 From: Dave L Date: Fri, 24 Mar 2023 19:14:32 +1100 Subject: [PATCH] Changed "ColorChoice::Always" to "ColorChoice::Auto" to honour user setting of TERM / NO_COLOR (#230) --- cli/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index e978d35d3..2e269bdaa 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, ) -> 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 {