-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Fixed output glitches when trying to use sectioned output larger then terminal and made terminal utility aware of resizes #41266
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
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
It might fix #35012 |
…n terminal The current console section utility implementation was not aware of the output terminals dimensions causing a variety of rendering glitches when trying to overwrite section contents that are larger then the displaying terminal. Root of the problem is the inability to move the cursor above the terminal home position using ANSI/VT100 control escape sequences. The implementation has been extended to compute and apply partial differences limited to the visible part of the terminal.
… soon as possible
@arnegroskurth What is the state of this PR? Do you plan to finish it at some point? If not, any hint about what needs to be done in order to finish it would be appreciated, so that someone else can take over. |
Closing due to the lack of feedback. Thanks for starting this, hope someone will take over. |
if ($message !== '' && substr($message, -1) !== PHP_EOL) { | ||
$message .= PHP_EOL; | ||
$messageWithNewline = $message; | ||
if ($messageWithNewline !== '' && substr($messageWithNewline, -1) !== PHP_EOL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note, PHP_EOL
can be two characters long (on Windows): https://heap.space/xref/php-src/main/php.h?r=bf29ee69#66
Hence, something like str_ends_with($messageWithNewline, \PHP_EOL)
(From php 8.0 or polifill) would be required here.
The current console section utility implementation was not aware of the output terminals dimensions causing a variety of rendering glitches when trying to cear or overwrite section contents that are larger then the displaying terminal.
Root of the problem is the inability to move the cursor above the terminal home position using ANSI/VT100 control escape sequences. The implementation has been extended to:
However, there a couple of things I'm not sure about:
pcntl
extension to listen for the POSIXSIGWINCH
signal - is there anything similar to this on Windows?