Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#39142 - [bash-completion] bash file completion involving ~ fails
Attached to Project:
Arch Linux
Opened by Peter Wu (Lekensteyn) - Tuesday, 04 March 2014, 10:51 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Sunday, 12 June 2016, 09:31 GMT
Opened by Peter Wu (Lekensteyn) - Tuesday, 04 March 2014, 10:51 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Sunday, 12 June 2016, 09:31 GMT
|
DetailsDescription:
Since upgrading bash, tab completions involving ~ do not complete any files or directories. Examples: * ~<TAB> - properly suggests user names * ~/<TAB> - only suggests directories, not file names * ~peter/<TAB> - same as above * ~/.ssh/<TAB> - *no* suggestions at all This has a great impact on my productivity with bash, please withold from upgrading until this is sorted out. Package versions: bash 4.3-2 (testing) bash-completion 2.1-2 |
This task depends upon
Closed by Bartłomiej Piotrowski (Barthalion)
Sunday, 12 June 2016, 09:31 GMT
Reason for closing: Fixed
Sunday, 12 June 2016, 09:31 GMT
Reason for closing: Fixed
Downgrading to 4.2.045-5 and completion works fine.
This patch[1] solves the completion issue with ls, but vim still has issues.
I've made another workaround (see attached patch) that fixes the issue completely for me. This is very likely unacceptable for upstream bash-completion, but works for now.
[1]: http://lists.alioth.debian.org/pipermail/bash-completion-devel/2013-February/004740.html
$ printf '%q\n' '~/.ssh/'
~/.ssh/ # in bash < 4.3
\~/.ssh/ # in bash >= 4.3
Using <tab><tab> to list files in a directory with escaped characters in it's name doesn't work in 4.3 either.
e.g. ls ./this\ directory/<tab><tab> does nothing.
downgrading to 4.2 has things working like they always have.
I was under the impression since the bug had been assigned then reassigned it would now be marked "Assigned".
Don't know who would be responsible for that or if it is even relevant...
$<TAB> -bash: words: bad array subscript
$<TAB> -bash: words: bad array subscript
$<TAB> -bash: words: bad array subscript
$<TAB><TAB> -bash: words: bad array subscript
-bash: words: bad array subscript
pkg/ src/
$ <spaces><TAB>
e.g.
$ -bash: words: bad array subscript
-bash: words: bad array subscript
This is the possible troublesome path where cword becomes negative (in reverse order):
__reassemble_comp_words_by_ref
__get_cword_at_cursor_by_ref
_get_comp_words_by_ref
_init_completion
Display all 148 possibilities? (y or n)
OT: Ubuntu and Debian are also affected:
https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1288031
Tip: if you want to debug this, use `set -x` for more details (its inverse is `set +x`).
I applied bash-4.3.patch from r208062 to /usr/share/bash-completion/bash_completion (after reverting my changes),
but the issue persists (unable to tab-complete ~/.ssh/).
I encountered another (related?) issue, file completion does not occur at all when no key words are given. For instance:
$ ls <TAB><TAB>
(completions shown, but without files such as .bashrc)
$ ls .<TAB><TAB>
(now files are included)
greetings
I can also list the files in .ssh/ with ~/.ssh/<tab><tab>.
Thanks.
Specifically, the completion of the type:
$ links $(<~/te<TAB>) doesn't work (it used to). Instead, I get
bash: unexpected EOF while looking for matching `)'
bash: syntax error: unexpected end of file, I think in _quote_readline_by_ref()
I can open a separate bug report, but perhaps it's better to keep completion-related regressions in one place.
Thanks.
[1] https://lists.gnu.org/archive/html/bug-bash/2014-03/msg00123.html
[2] http://pkgbuild.com/~barthalion/tmp/fs39142/
What is this patch supposed to fix?
The above patch makes the error go away (so the length of the input string is calculated properly AFAIU), but the completion still doesn't work:
-----
$ pacman -Q bash bash-completion
bash 4.3-3.1
bash-completion 2.1-4
$ echo 1 > /tmp/1.pid
$ cat /tmp/1.pid
1
$ kill $(cat /tmp/<TAB>)
-----
... and the shell doesn't complete the filename.
I did not look in detail at what happens, but I'll do and report this upstream.
https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1289597
I seem to be affected by it even in -4.