diff options
Diffstat (limited to 'src/context/mod.rs')
-rw-r--r-- | src/context/mod.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/context/mod.rs b/src/context/mod.rs index 21472ac..c7e060a 100644 --- a/src/context/mod.rs +++ b/src/context/mod.rs @@ -326,7 +326,11 @@ impl Context { /// the Coloring, and whether or not stdout is connected to a tty. /// /// If Coloring is Force then this will always evaluate to `false`. - pub const fn no_color(&self) -> bool { + pub fn no_color(&self) -> bool { + if let Some(Some(var)) = color::NO_COLOR.get() { + return !var.is_empty(); + } + match self.color { Coloring::Auto if !self.stdout_is_tty => true, Coloring::None => true, |