[Console] Suppress proc_open errors within Terminal::readFromProcess#58332
Merged
nicolas-grekas merged 1 commit intosymfony:5.4from Sep 28, 2024
Merged
Conversation
|
Hey! Thanks for your PR. You are targeting branch "7.2" but it seems your PR description refers to branch "5.4". Cheers! Carsonbot |
Contributor
Author
|
Instead of using |
xabbuh
approved these changes
Sep 22, 2024
Member
|
Thank you @fritzmg. |
Contributor
Author
|
@nicolas-grekas should I do a separate PR for Symfony 6, as the code is different there? |
Member
|
@fritzmg I think merging |
Contributor
Author
|
Ah yes, all good 👍 |
This was referenced Oct 27, 2024
Merged
Merged
Merged
1 task
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
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 instantiating
SymfonyStylein a command it will try to determine the maximum width of the current console interface.symfony/src/Symfony/Component/Console/Style/SymfonyStyle.php
Line 53 in 6687e4e
This will execute
stty -a | grep columnsdown the line. Access tosttymight be disallowed however, resulting in the following error:(Stack Trace actually from Symfony 6)
The phpDoc of
Terminal::getSttyColumnsstatesThe latter might refer to
['suppress_errors' => true](though I am not sure) - which is a Windows only functionality. In any case, sinceTerminal::readFromProcessalready checks forand
upstream in Symfony 6/7, indicating that
proc_openmight fail - this error can additionally be suppressed using@. Besides,Process::startalso uses@proc_open(added in 099481f "Prevent warning in proc_open()").