diff --git a/src/bin/main.rs b/src/bin/main.rs index 62abcf1..cc14bc0 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -231,7 +231,7 @@ fn run_with_input(cli: Cli, input: impl Input) -> Result<()> { match output_format { SerializationFormat::Json => { let is_stdout_terminal = stdout().is_terminal(); - let no_color_from_env = || std::env::var("NO_COLOR").is_ok_and(|s| !s.is_empty()); + let no_color_from_env = || std::env::var_os("NO_COLOR").is_some_and(|s| !s.is_empty()); let should_colorize_output = cli.output_format.color_output || (is_stdout_terminal && !cli.output_format.monochrome_output