comparison vendor/symfony/console/Helper/ProgressBar.php @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents 129ea1e6d783
children
comparison
equal deleted inserted replaced
17:129ea1e6d783 18:af1871eacc83
464 */ 464 */
465 private function overwrite($message) 465 private function overwrite($message)
466 { 466 {
467 if ($this->overwrite) { 467 if ($this->overwrite) {
468 if (!$this->firstRun) { 468 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
475 // Erase previous lines 469 // Erase previous lines
476 if ($this->formatLineCount > 0) { 470 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;
478 } 472 }
473
474 // Move the cursor to the beginning of the line and erase the line
475 $message = "\x0D\x1B[2K$message";
479 } 476 }
480 } elseif ($this->step > 0) { 477 } elseif ($this->step > 0) {
481 $this->output->writeln(''); 478 $message = PHP_EOL.$message;
482 } 479 }
483 480
484 $this->firstRun = false; 481 $this->firstRun = false;
485 482
486 $this->output->write($message); 483 $this->output->write($message);