[Bug 1229795] New: bash completion adds backslash before equal sign
https://bugzilla.suse.com/show_bug.cgi?id=1229795 Bug ID: 1229795 Summary: bash completion adds backslash before equal sign Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: All URL: https://forums.opensuse.org/t/bash-tab-autocomplete-ad ds-backslash-before-equal-sign/178072 OS: openSUSE Tumbleweed Status: NEW Severity: Minor Priority: P5 - None Component: Usability Assignee: screening-team-bugs@suse.de Reporter: alanas.00@mail.ru QA Contact: qa-bugs@suse.de Target Milestone: --- Found By: --- Blocker: --- this is duplicate of https://forums.opensuse.org/t/bash-tab-autocomplete-adds-backslash-before-eq... 1. open terminal 2. type `cp --t` 3. press tab expected result (like ubuntu): `cp --target-directory=` actual result: `cp --target-directory\=` bash escapes `=` because `filenames` comp-option is always on because these openSUSE-specific bash-completion patches: • https://build.opensuse.org/projects/openSUSE:Factory/packages/bash-completio... • https://build.opensuse.org/projects/openSUSE:Factory/packages/bash-completio... see https://forums.opensuse.org/t/bash-tab-autocomplete-adds-backslash-before-eq... -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1229795 https://bugzilla.suse.com/show_bug.cgi?id=1229795#c1 Henk van Velden <henk.vanvelden@xs4all.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |henk.vanvelden@xs4all.nl --- Comment #1 from Henk van Velden <henk.vanvelden@xs4all.nl> --- It not only works that strange with this long option expansion, but also with a simple file name: henk@boven:~/test/co> touch aap=noot henk@boven:~/test/co> l total 8 drwxr-xr-x 2 henk wij 4096 Aug 26 10:33 ./ drwxr-xr-x 11 henk wij 4096 Aug 26 10:33 ../ -rw-r--r-- 1 henk wij 0 Aug 26 10:33 aap=noot henk@boven:~/test/co> rm aap\=noot where I hit the Tab somewhere within aap. So it uses the \ for completion, but I have no idea why. I see no reason to escape the = at all. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1229795 https://bugzilla.suse.com/show_bug.cgi?id=1229795#c2 --- Comment #2 from BZZZZ DZZZZ <alanas.00@mail.ru> --- (In reply to Henk van Velden from comment #1)
It not only works that strange with this long option expansion, but also with a simple file name: henk@boven:~/test/co> touch aap=noot henk@boven:~/test/co> l total 8 drwxr-xr-x 2 henk wij 4096 Aug 26 10:33 ./ drwxr-xr-x 11 henk wij 4096 Aug 26 10:33 ../ -rw-r--r-- 1 henk wij 0 Aug 26 10:33 aap=noot henk@boven:~/test/co> rm aap\=noot where I hit the Tab somewhere within aap. So it uses the \ for completion, but I have no idea why. I see no reason to escape the = at all.
not openSUSE specific, `=` escaping in file name also happens in debian ( magnet:?xt=urn:btih:8D74BC4CE4DE82A26D1374872C0E7021F0BB32EB&dn=debian-live-12.6.0-amd64-lxqt.iso ) and that debian live iso doesn't have bash-completion installed -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1229795 https://bugzilla.suse.com/show_bug.cgi?id=1229795#c6 --- Comment #6 from Dr. Werner Fink <werner@suse.com> --- (In reply to Henk van Velden from comment #3)
Sorry, but I do not see what Debian has to do with it. We are reporting about openSUSE.
When people see it is the same in other distributions, then it is probably an upstream bug.
Indeed upstream bug ... whereas I had already patched bash_completion script for bug boo#958462: --- bash-completion-2.12.0/bash_completion +++ bash-completion-2.12.0/bash_completion 2024-02-23 08:12:55.346856835 +0000 @@ -3047,11 +3047,12 @@ complete -F _comp_complete_longopt -o fi a2ps awk base64 bash bc bison cat chroot colordiff cp \ csplit cut date df diff dir du enscript expand fmt fold gperf \ grep grub head irb ld ldd less ln m4 mkdir mkfifo mknod \ - mv nl nm objcopy objdump od paste pr ptx readelf rm rmdir \ + mv nl nm objcopy objdump od paste pr ptx readelf \ sed shar sort split strip sum tac tail tee \ texindex touch tr unexpand uniq vdir wc who complete -F _comp_complete_longopt -o default env netstat seq uname units complete -F _comp_complete_longopt -o bashdefault -o default -o filenames ls ll la l ls-l lf +complete -F _comp_complete_longopt -o bashdefault -o default -o filenames rm rmdir # @since 2.12 declare -Ag _comp_xspecs ... otherwise more that the equal sign would be mishandled. But the original complete -F _comp_complete_longopt -o filenames rm also fails. Btw: Upstream never accepted the fix above, they want a test case. Try to report this upstream, maybe this bears fruits ... -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1229795 https://bugzilla.suse.com/show_bug.cgi?id=1229795#c7 --- Comment #7 from Dr. Werner Fink <werner@suse.com> --- Not to forget patch bash-completion-2.4.patch as well as ls-completion-boo889319.patch and respect-variables-boo940837.patch -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1229795 https://bugzilla.suse.com/show_bug.cgi?id=1229795#c9 Michael Pujos <pujos.michael@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pujos.michael@gmail.com --- Comment #9 from Michael Pujos <pujos.michael@gmail.com> --- There is also this issue with directories with ':' in their name, which is frequent for OBS repos (for example home:user:branches:games): Example: mkdir test:lol cd test<TAB> cd test\:lol/ (<= completion) Slso there is problem with completion for files in such folders if a backlash does not precede the ':' : echo "TROLOLOL" > test:lol/blargh ls test:lol/<TAB> (=> no completion) ls test\:lol/<TAB> (=> completion to test\:lol/blargh) -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1229795 https://bugzilla.suse.com/show_bug.cgi?id=1229795#c10 --- Comment #10 from BZZZZ DZZZZ <alanas.00@mail.ru> --- (In reply to Michael Pujos from comment #9)
There is also this issue with directories with ':' in their name, which is frequent for OBS repos (for example home:user:branches:games):
Example:
mkdir test:lol cd test<TAB> cd test\:lol/ (<= completion)
Slso there is problem with completion for files in such folders if a backlash does not precede the ':' :
echo "TROLOLOL" > test:lol/blargh ls test:lol/<TAB> (=> no completion) ls test\:lol/<TAB> (=> completion to test\:lol/blargh)
dummycmd test:test\:lol/<TAB> dummycmd test:test\:lol/blargh (<= completion) dummycmd test=test\:lol/<TAB> dummycmd test=test\:lol/blargh (<= completion) bash treats unescaped characters in $COMP_WORDBREAKS as boundaries for completion default $COMP_WORDBREAKS includes '=' and ':' ( https://github.com/bminor/bash/blob/142bbdd89e4d5bb62aea4469d1d2c24cf470afd8... ) this is unrelated to bash-completion (non-builtin scripts) -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com