Skip to content

Commit

Permalink
bug #47394 [Console] [Completion] Make bash completion run in non int…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
fabpot committed Sep 2, 2022
2 parents 72a3ad5 + cf0b56f commit 0b0cbd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Resources/completion.bash
Expand Up @@ -24,7 +24,7 @@ _sf_{{ COMMAND_NAME }}() {
local cur prev words cword
_get_comp_words_by_ref -n := cur prev words cword

local completecmd=("$sf_cmd" "_complete" "-sbash" "-c$cword" "-S{{ VERSION }}")
local completecmd=("$sf_cmd" "_complete" "--no-interaction" "-sbash" "-c$cword" "-S{{ VERSION }}")
for w in ${words[@]}; do
w=$(printf -- '%b' "$w")
# remove quotes from typed values
Expand Down

0 comments on commit 0b0cbd3

Please sign in to comment.