On Thu, Sep 24, 2009 at 6:36 PM, David Paleino <d.pale...@gmail.com> wrote: > This is due to COMP_WORDBREAKS containing "=":
I guess this bug turns up on bash-4 only? This can be fixed by adding `=' as an argument to `_get_cword' so that _get_cword on bash-4 doesn't split words on `='. Done so in commit f871fe4. Explanation: Bash-4 breaks COMP_WORDS by characters listed in COMP_WORDBREAKS: $ echo -n "$COMP_WORDBREAKS" | od -abc 0000000 sp ht nl " ' > < = ; | & ( : 040 011 012 042 047 076 074 075 073 174 046 050 072 \t \n " ' > < = ; | & ( : 0000015 whereas bash-3 didn't. If you use COMP_CWORDS, this is what you get on bash-4: $ dd if=<TAB> COMP_CWORD: 2 COMP_CWORDS: 0: dd 1: if 2: = Bash-3 returns: COMP_CWORD: 1 COMP_CWORDS: 0: dd 1: if= To reproduce: Create function `_cword' and let it complete `dd' _cword() { echo echo COMP_CWORD: $COMP_CWORD echo COMP_CWORDS: for ((i=0; i < ${#comp_wor...@]}; i++)); do echo $i: "${COMP_WORDS[$i]}" done } complete -F _cword dd By using _get_cword you can overcome this difference. Greetings, Freddy Vulto http://fvue.nl _______________________________________________ Bash-completion-devel mailing list Bash-completion-devel@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/bash-completion-devel