Skip to content

[Console] Progress bar does not clear multi-line formats #42684

Closed
@rtek

Description

@rtek

Symfony version(s) affected: 5.3.4

Description
Multiline progress bar formats are not cleared during overwrite so old message parts may remain.

How to reproduce

// Command class
protected function execute(InputInterface $input, OutputInterface $output): int
{
        $output->writeln('START TEST');

        $bar = new ProgressBar($output, 2);
        $bar->setFormat("[%bar%]\n%message%");
        $bar->setMessage('123456790');
        $bar->advance();
        $bar->display();
        $bar->setMessage('ABC');
        $bar->advance();
        $bar->display();
        $bar->finish();

        $output->writeln('');
        $output->writeln('END TEST');

        return 0;
}

image

Possible Solution
PR to be linked shortly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions