-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Progress bar clear/display remove too many lines #47987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
Yes, I can reproduce that with the example. I'll try a fix for that. |
Status: Reviewed |
fabpot
added a commit
that referenced
this issue
Nov 11, 2022
…al `ProgressBar::cleanup()` (maxbeckers) This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Console] Fix console `ProgressBar::override()` after manual `ProgressBar::cleanup()` | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #47987 | License | MIT | Doc PR | In the issue #47987 is described, that there is a problem with overriding lines with `ProgressBar::override()` on a multiline console output with manual call of `ProgressBar::cleanup()`. Testcode: ``` ProgressBar::setFormatDefinition('normal_nomax', "[%bar%]\n%message%"); $progressBar = new ProgressBar($output); $progressBar->setMessage('Processing "foobar"...'); $progressBar->start(); $progressBar->clear(); $output->writeln('Foo!'); $progressBar->display(); $progressBar->finish(); ``` Output before the fix: ``` Progress bar having only one line: Foo! [----->----------------------] =-=-=-= Progress bar having two lines: [----->----------------------] Processing "foobar"... ``` Expected output / output after the fix: ``` Progress bar having only one line: Foo! [----->----------------------] =-=-=-= Progress bar having two lines: Foo! [----->----------------------] Processing "foobar"... ``` Commits ------- aa661aa [Console] Fix console `ProgressBar::override()` after manual `ProgressBar::cleanup()`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected
5.4.14
Description
When using documented logic to display a message in the middle of a progress bar iteration,
Symfony\Component\Console\Helper\ProgressBar::clear()
/Symfony\Component\Console\Helper\ProgressBar::display()
will remove too many lines if progress bar format contains multiple lines.How to reproduce
Output will be:
but is expected to be:
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: