Zulip discussion: #t-compiler > Rustc `--color always` doesn't always color output
While working on #150895, I discovered that some parts of rustc that use --color flag don't always output color when the flag is set to always.
Relevant Examples:
|
if io::stdout().is_terminal() { |
|
show_md_content_with_pager(&text, color); |
|
} else { |
|
safe_print!("{text}"); |
|
} |
|
let emit_color = if supports_color { |
|
ColorConfig::from(color) |
|
} else { |
|
ColorConfig::Never |
|
}; |
The check for terminal support should only occur when the option is set to auto. There may be more examples for this as well. These are just the two that I could find.
Zulip discussion: #t-compiler > Rustc `--color always` doesn't always color output
While working on #150895, I discovered that some parts of
rustcthat use--colorflag don't always output color when the flag is set toalways.Relevant Examples:
rust/compiler/rustc_driver_impl/src/lib.rs
Lines 494 to 498 in 4d38622
rust/src/tools/rustfmt/src/parse/session.rs
Lines 102 to 106 in 4d38622
The check for terminal support should only occur when the option is set to
auto. There may be more examples for this as well. These are just the two that I could find.