-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Signal does not work with Question #38820
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
Comments
Good catch. Not subscribing to any signal by default makes sense to me 👍 |
@chalasr, but if we do that, the whole system with Symfony Event could not work anymore. What about my proposal ? |
@lyrixx Sorry, I missed that part. I see now, enabling the feature from the command (typically worker) sounds good. Could we rely on |
IMHO, we need another one, because one may want to use only event, without bothering with handling manually the signal. I'll propose a PR soon |
Symfony version(s) affected: 5.2.x
I broke symfony, sorry !
Description
Signal handling does not work well with question!
How to reproduce
Use
bin/console make:controller
and then press CTRL+C=> it does not work anymore until you press enter
Possible Solution
Empty this list https://github.com/symfony/symfony/blob/5.x/src/Symfony/Component/Console/Application.php#L94
Most of the time, we don't care about signal. It's only useful for long running process. But since we use this list before running the command, the "Signal To Symfony Event" feature will become hard to implement. We may register signal listener if the command implement a certain insterface.
The other solution would be to not use
fgets
butstream_select()
Additional context
I created a simple reproducer:
=>
As you can see, I pressed 4 times CTRL+C and it did not worked until I pressed enter
The text was updated successfully, but these errors were encountered: