Johannes Winkelmann schrieb:
Hi there,
For those of you using bash-completion, please note that I've committed an updated port which works again with bash 4. There's a small change required to make it work however, which is changing . /usr/share/bash-completion/init_bc into . /etc/bash_completion in your login scripts.
IMHO there is a quoting error in _filedir() which prevents normal files to appear in the list for commands like ls, vi etc. (tested under 4.0.28). The attached patch should correct it. Regards, Bernd -- Bernd Eggink http://sudrala.de --- bash_completion 2009-08-02 10:18:56.000000000 +0200 +++ bash_completion.ok 2009-08-02 14:42:16.000000000 +0200 @@ -267,6 +267,7 @@ # _filedir() { + set -x local IFS=$'\t\n' xspec _expand || return 0 @@ -285,7 +286,7 @@ # bash-3.1. See also: # http://www.mail-archive.com/bug-bash@gnu.org/msg01667.html toks=( ${toks[@]-} $( - compgen -d -- "$(quote_readline "$cur")" | { + compgen -d -- $(quote_readline "$cur") | { while read -r tmp; do echo $tmp done @@ -295,7 +296,7 @@ if [[ "$1" != -d ]]; then xspec=${1:+"!*.$1"} toks=( ${toks[@]-} $( - compgen -f -X "$xspec" -- "$(quote_readline "$cur")" | { + compgen -f -X "$xspec" -- $(quote_readline "$cur") | { while read -r tmp; do [ -n $tmp ] && echo $tmp done @@ -304,6 +305,7 @@ fi COMPREPLY=( "${COMPREPLY[@]}" "${toks[@]}" ) + } # This function tries to parse the output of $command --help