As in ubuntu bug report, TAB on empty line produces an unneded error message: https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1289597 patch can be found in bug report. (https://code.launchpad.net/~j/bash-completion/bug1289597/+merge/210089)
Auto-assigned to maintainer adamw@FreeBSD.org
Hi Adam, This boils down to a 1 line (2 character) patch: --- bash_completion.orig +++ bash_completion @@ -707,7 +707,7 @@ _init_completion() fi done - [[ $cword -eq 0 ]] && return 1 + [[ $cword -le 0 ]] && return 1 prev=${words[cword-1]} [[ ${split-} ]] && _split_longopt && split=true If you are busy, I could apply this for you. This ticket was originally posted for dports, but I requested that it be elevated to ports so FreeBSD would benefit too.
A commit references this bug: Author: adamw Date: Tue Jan 20 16:22:18 UTC 2015 New revision: 377528 URL: https://svnweb.freebsd.org/changeset/ports/377528 Log: Add a patch to fix tab on an empty line producing: $ bash: words: bad array subscript PR: 196713 Submitted by: gnudalf@yandex.com Obtained from: upstream bug #1289597 Changes: head/shells/bash-completion/Makefile head/shells/bash-completion/files/patch-bash__completion
Committed, thanks. And thanks for the reminder, John.