fix: status mesages go to stderr not stdout (#483)

Progress spinner and status line are written to stderr
instead of stdout.

No longer any need to detect if stdout is being redirected.
This commit is contained in:
andy.boot
2025-04-01 23:19:36 +01:00
committed by GitHub
parent 1b4116e39d
commit 9a49221ac1
3 changed files with 14 additions and 11 deletions
+1 -4
View File
@@ -4,7 +4,6 @@ use clap::ArgMatches;
use config_file::FromConfigFile;
use regex::Regex;
use serde::Deserialize;
use std::io::IsTerminal;
use std::path::Path;
use std::path::PathBuf;
@@ -54,9 +53,7 @@ impl Config {
Some(true) == self.force_colors || options.get_flag("force_colors")
}
pub fn get_disable_progress(&self, options: &ArgMatches) -> bool {
Some(true) == self.disable_progress
|| options.get_flag("disable_progress")
|| !std::io::stdout().is_terminal()
Some(true) == self.disable_progress || options.get_flag("disable_progress")
}
pub fn get_apparent_size(&self, options: &ArgMatches) -> bool {
Some(true) == self.display_apparent_size || options.get_flag("display_apparent_size")