Skip to content

Commit 992c3c0

Browse files
committed
Remove unnecessary ProgressBar stdout writes (fixes flickering)
1 parent 069bf3f commit 992c3c0

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Helper/ProgressBar.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -466,19 +466,16 @@ private function overwrite($message)
466466
{
467467
if ($this->overwrite) {
468468
if (!$this->firstRun) {
469-
// Move the cursor to the beginning of the line
470-
$this->output->write("\x0D");
471-
472-
// Erase the line
473-
$this->output->write("\x1B[2K");
474-
475469
// Erase previous lines
476470
if ($this->formatLineCount > 0) {
477-
$this->output->write(str_repeat("\x1B[1A\x1B[2K", $this->formatLineCount));
471+
$message = str_repeat("\x1B[1A\x1B[2K", $this->formatLineCount).$message;
478472
}
473+
474+
// Move the cursor to the beginning of the line and erase the line
475+
$message = "\x0D\x1B[2K$message";
479476
}
480477
} elseif ($this->step > 0) {
481-
$this->output->writeln('');
478+
$message = PHP_EOL.$message;
482479
}
483480

484481
$this->firstRun = false;

0 commit comments

Comments
 (0)