diff --git a/src/Configuration/ConfigurationFactory.php b/src/Configuration/ConfigurationFactory.php index c79f434f5d1..5030e638cfa 100644 --- a/src/Configuration/ConfigurationFactory.php +++ b/src/Configuration/ConfigurationFactory.php @@ -150,6 +150,11 @@ private function shouldShowProgressBar(InputInterface $input, string $outputForm return false; } + // no interactive terminal, e.g. piped output, CI or an agent - the redraws are just noise + if (! $this->isTtyOutput()) { + return false; + } + if ($this->symfonyStyle->isVerbose()) { return false; } @@ -157,6 +162,11 @@ private function shouldShowProgressBar(InputInterface $input, string $outputForm return $outputFormat === ConsoleOutputFormatter::NAME; } + private function isTtyOutput(): bool + { + return defined('STDOUT') && stream_isatty(STDOUT); + } + private function shouldShowDiffs(InputInterface $input): bool { $noDiffs = (bool) $input->getOption(Option::NO_DIFFS);