From 9dcce5f1bdd76e7564d604ab8b87bbc7caad310a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Sat, 8 Jan 2022 09:11:19 -0800 Subject: [PATCH] fix(colors): treat no-color mode as no-color instead of narratable (#94) Fixes: https://github.com/zkat/miette/issues/93 BREAKING CHANGE: NO_COLOR no longer triggers the narrated handler. Use NO_GRAPHICS instead. --- src/handler.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/handler.rs b/src/handler.rs index ceb2202..7ccfd71 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -188,8 +188,8 @@ impl MietteHandlerOpts { !force_narrated } else if let Some(force_graphical) = self.force_graphical { force_graphical - } else if let Some(info) = supports_color::on(Stream::Stderr) { - info.has_basic + } else if let Ok(env) = std::env::var("NO_GRAPHICS") { + env == "0" } else { false }