-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Bash completions as root hangs the shell #11024
Comments
Can you please try to apply symfony/symfony#47394 to your completion file to check it fixes it for you? |
I tested with the root user and it works without hangs the shell. |
…eractive mode (Seldaek) This PR was merged into the 5.4 branch. Discussion ---------- [Console] [Completion] Make bash completion run in non interactive mode | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Refs composer/composer#11024 Composer does prompt in some contexts, and that blocks/freezes the completion as it runs in an interactive context but is not actually visible. Explicitly setting it to be non interactive seems to be the fix to me. TODO: - [ ] A similar fix probably should be applied to other completion types supported in newer versions than 5.4 Commits ------- cf0b56f Make bash completion run in non interactive mode
Should this be closed because it was already solved in symfony ? or do you prefer to wait until it actually is released in composer ? |
Looked again at fixing symfony/symfony#47394 (comment) and then I took the opportunity to also fix this issue at the same time, even for those without the updated |
When running without `COMPOSER_ALLOW_SUPERUSER` set so it always happens after prompting, or does not happen if input is non-interactive. Also fixed support for bash completions hanging when running as root Fixes composer#11024
My
composer.json
:I don't have composer.json because I don't have a project.
Output of
composer diagnose
:When I run this command:
Here I can't see the autocompletion for root user and the shell terminal is blocked. I can't cancel with CTRL+C. I must close the terminal window.
I get the following output:
And I expected this to happen:
I expected to see autocompleted commands for root user.
I debugged the issue and I found the completion command is:
and when I execute this command as root, composer ask confirmation because I'm root:
Possible solutions
Maybe we never autocomplete for root, but it must not block the shell.
Or maybe we always autocomplete for root and we never ask confirmation, like this :
The text was updated successfully, but these errors were encountered: