progress: Restore tty-detection after refactoring

This commit is contained in:
Zhaofeng Li 2021-12-04 01:03:26 -08:00
parent ba16f50722
commit dc57b489ea
5 changed files with 9 additions and 7 deletions

View file

@ -93,7 +93,9 @@ pub enum LineStyle {
impl SimpleProgressOutput {
pub fn new(verbose: bool) -> Self {
if verbose {
let tty = atty::is(atty::Stream::Stdout);
if verbose || !tty {
Self::Plain(PlainOutput::new())
} else {
Self::Spinner(SpinnerOutput::new())