Merge pull request #2416 from topecongiro/eshell
Explicitly disable colored output when it is not supported
This commit is contained in:
commit
fe06b96f48
@ -615,7 +615,13 @@ pub fn format_input<T: Write>(
|
||||
));
|
||||
Handler::with_emitter(true, false, silent_emitter)
|
||||
} else {
|
||||
Handler::with_tty_emitter(ColorConfig::Auto, true, false, Some(codemap.clone()))
|
||||
let supports_color = term::stderr().map_or(false, |term| term.supports_color());
|
||||
let color_cfg = if supports_color {
|
||||
ColorConfig::Auto
|
||||
} else {
|
||||
ColorConfig::Never
|
||||
};
|
||||
Handler::with_tty_emitter(color_cfg, true, false, Some(codemap.clone()))
|
||||
};
|
||||
let mut parse_session = ParseSess::with_span_handler(tty_handler, codemap.clone());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user