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
"symfony run" interactivity broken after v5.7.5 #404
Comments
Set SysProcAttr Foreground: true when user run cmd. Fixes: #404
Originally posted by @fabpot in #405 (comment) @fabpot can we open this again as the fix was reverted? Can you provide a bit more info about how it doesn't work? From my testing I managed to reproduce the hangs and ^C doesn't work only if
It ONLY breaks after a change is detected, which kinda makes sense because we were making the cmd process to have its own pgid, then we are killing it from watcher goroutine from symfony. My strong suspicion is these leads to inconsistent behavior because of terminal's foreground behavior and read / write / piping std{in,our,err} of parent process and child process. Can you confirm that it breaks for you for this use case ONLY? Other ways to invoke runner like
I can reproduce the hang even with currently published v5.8.6 (which doesn't have my
If that's the case (broken only with watcher), I can think of two alternate solutions:
Please advice :) I'm actually very eager to restore the interactivity, as I regularly use the |
I can conform this is happening to me as well, with version |
How can we connect to psql in the remote server without using |
@fabpot looks good in Ubuntu. I problem I described about hanging when run with
@carlos-granados |
"symfony run" interactivity broken after ff1958f
In this commit runner code was changed, the specific line is
symfony-cli/local/runner_posix.go
Lines 11 to 16 in 041d007
Setting
Setpgid
to true loses stdin connection to terminal from the command, resulting in this.It just hangs there. Anything typed in the terminal doesn't go through to the psql process. You can check by simple
symfony run cat
.If I set Setpgid to false and compile it works. But that would obviously break the the original issue the referenced commit fixed. I think a proper solution would be tcgetpgrp, which we can make golang call if we also set
Foreground: true
This fixes interactive commands. We have to take care to set
Foreground: true
only when user is running symfony run something interactively, not for worker/daemons. So Runner.Mode needs to be passed to buildCmd function.I'll send a PR with complete fix.
update; PR opened #405
The text was updated successfully, but these errors were encountered: