-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] avoid multiple new line when message already ends with a new line in section output #51378
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
Merged
nicolas-grekas
merged 1 commit into
symfony:6.3
from
joelwurtz:fix/write-with-new-line-in-message
Aug 16, 2023
Merged
[Console] avoid multiple new line when message already ends with a new line in section output #51378
nicolas-grekas
merged 1 commit into
symfony:6.3
from
joelwurtz:fix/write-with-new-line-in-message
Aug 16, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7b73257
to
b8c2675
Compare
maxbeckers
reviewed
Aug 14, 2023
b8c2675
to
1f20f72
Compare
lyrixx
approved these changes
Aug 16, 2023
welcoMattic
approved these changes
Aug 16, 2023
Thank you @joelwurtz. |
Merged
renovate bot
added a commit
to Lendable/composer-license-checker
that referenced
this pull request
Aug 26, 2023
[](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [symfony/console](https://symfony.com) ([source](https://togithub.com/symfony/console)) | require | patch | `6.3.2` -> `6.3.4` | | [symfony/process](https://symfony.com) ([source](https://togithub.com/symfony/process)) | require | patch | `6.3.2` -> `6.3.4` | --- ### Release Notes <details> <summary>symfony/console (symfony/console)</summary> ### [`v6.3.4`](https://togithub.com/symfony/console/releases/tag/v6.3.4) [Compare Source](https://togithub.com/symfony/console/compare/v6.3.2...v6.3.4) **Changelog** (symfony/console@v6.3.3...v6.3.4) - bug [symfony/symfony#51378](https://togithub.com/symfony/symfony/issues/51378) \[Console] avoid multiple new line when message already ends with a new line in section output ([@​joelwurtz](https://togithub.com/joelwurtz)) - bug [symfony/symfony#51223](https://togithub.com/symfony/symfony/issues/51223) \[Console] Fix linewraps in `OutputFormatter` (@​maxbeckers) - bug [symfony/symfony#51355](https://togithub.com/symfony/symfony/issues/51355) \[Console] fix section output when multiples section with max height ([@​joelwurtz](https://togithub.com/joelwurtz)) </details> <details> <summary>symfony/process (symfony/process)</summary> ### [`v6.3.4`](https://togithub.com/symfony/process/compare/v6.3.2...v6.3.4) [Compare Source](https://togithub.com/symfony/process/compare/v6.3.2...v6.3.4) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/Lendable/composer-license-checker). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi41Ni4wIiwidXBkYXRlZEluVmVyIjoiMzYuNTYuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
😢 This broke our project, which uses progress bars to build a checklist-style output. It results in too many lines being cleared when the progress bar advances: https://github.com/acquia/cli/issues/1620 I'd appreciate your input, as it's not obvious to me why it broke. |
@danepowell Please consider submitting a new issue on this repo so that it's properly tracked |
I opened #52446 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we write to the section with a new line in the message it ends up adding a double new line, it can be easily seen when we set a section as a console handler for the logs, each line of log will have a double new line ending adding a lot of noise.
I began to fix the implementation to correctly handle this case, but with all the logic of the max height and other stuff it appears to be way more complicated.
Simulating this case by removing the new line at the end of the message and recalling the write function with the newline parameter to true was way easier and avoid too many headcache when looking at the code.
Should fix #50382