mirror of https://github.com/zkat/miette.git
fix(color): setting NO_COLOR should not print ansi codes for non-terminals (#381)
Fixes: https://github.com/zkat/miette/issues/380
This commit is contained in:
parent
b82cc81b8e
commit
813232ba79
|
|
@ -71,7 +71,7 @@ impl Default for GraphicalTheme {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
match std::env::var("NO_COLOR") {
|
match std::env::var("NO_COLOR") {
|
||||||
_ if !std::io::stdout().is_terminal() || !std::io::stderr().is_terminal() => {
|
_ if !std::io::stdout().is_terminal() || !std::io::stderr().is_terminal() => {
|
||||||
Self::ascii()
|
Self::none()
|
||||||
}
|
}
|
||||||
Ok(string) if string != "0" => Self::unicode_nocolor(),
|
Ok(string) if string != "0" => Self::unicode_nocolor(),
|
||||||
_ => Self::unicode(),
|
_ => Self::unicode(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue