ui: on progress output, also take pager status into account

This commit is contained in:
Yuya Nishihara 2023-06-12 21:37:17 +09:00
parent 1b0feb913d
commit dbe8d3fcdc

View file

@ -188,7 +188,10 @@ impl Ui {
/// Whether continuous feedback should be displayed for long-running /// Whether continuous feedback should be displayed for long-running
/// operations /// operations
pub fn use_progress_indicator(&self) -> bool { pub fn use_progress_indicator(&self) -> bool {
self.progress_indicator && io::stdout().is_tty() match &self.output {
UiOutput::Terminal { stdout, .. } => self.progress_indicator && stdout.is_tty(),
UiOutput::Paged { .. } => false,
}
} }
pub fn write(&mut self, text: &str) -> io::Result<()> { pub fn write(&mut self, text: &str) -> io::Result<()> {