Skip to content

Commit 2924491

Browse files
bug symfony#61724 [Console] Fix handling of \E in Bash completion (HypeMC)
This PR was merged into the 6.4 branch. Discussion ---------- [Console] Fix handling of `\E` in Bash completion | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT Related to symfony#43665 The problem with `$(printf -- '%b' "$w")` is that it also interprets `\E` as an escape sequence. For example, in ```bash bin/console debug:form 'Symfony\Component\Form\Extension\Core\Type\EmailType' ``` the `\E` in the class name is replaced with the ASCII escape character: ``` Symfony\Component\Form�xtension\Core\Type�mailType ``` This PR switches to simply replacing double backslashes with a single one instead of using `printf -- '%b'`. Commits ------- f1f50e6 [Console] Fix handling of `\E` in Bash completion
2 parents c6e2837 + f1f50e6 commit 2924491

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Console/Resources/completion.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ _sf_{{ COMMAND_NAME }}() {
3737

3838
local completecmd=("$sf_cmd" "_complete" "--no-interaction" "-sbash" "-c$cword" "-a{{ VERSION }}")
3939
for w in ${words[@]}; do
40-
w=$(printf -- '%b' "$w")
40+
w="${w//\\\\/\\}"
4141
# remove quotes from typed values
4242
quote="${w:0:1}"
4343
if [ "$quote" == \' ]; then

0 commit comments

Comments
 (0)