diff --git a/src/main.rs b/src/main.rs index af5907a..b7ba9cb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -81,9 +81,13 @@ async fn main() -> Result<()> { // Apply the global color decision before any output is produced. // --no-color disables colors; NO_COLOR follows the no-color.org spec - // (any presence, regardless of value, disables color). + // (any presence, regardless of value, disables color). Without them, + // color keeps colored's tty auto-detection (ADR-0003): piped output + // stays ANSI-free. let no_color = cli.no_color || std::env::var_os("NO_COLOR").is_some(); - colored::control::set_override(!no_color); + if no_color { + colored::control::set_override(false); + } // Resolve the decoration switch (issue 14): explicit flag > config > // default; --no-color disables decorations too (ADR-0003).