bash completion processing gone bad, how to debug?

Posted by msw on Super User See other posts from Super User or by msw
Published on 2010-05-17T19:05:03Z Indexed on 2010/05/17 19:11 UTC
Read the original article Hit count: 417

Filed under:
|

It all started with a simple

alias gv='gvim --remote-quiet'

and now gv Space Tab gives nothing where it normally should give filenames. Oddly,

alias gvi='gvim --remote-quiet'

works as expected. I clearly have a workaround, but I'd like to know what is catching my gv for special processing. compopt is no help as gv shares the same settings as ls which does filename completion correctly.

$compopt gv
compopt +o bashdefault +o default +o dirnames -o filenames +o nospace +o plusdirs gv
$ compopt ls
compopt +o bashdefault +o default +o dirnames -o filenames +o nospace +o plusdirs ls

The complete command is slightly more helpful but it doesn't tell me why my two characters got singled out for alteration:

$ complete -p gv
complete -o filenames -F _filedir_xspec gv
$ complete -p ls
complete -o filenames -F _longopt ls
$ complete -p echo
bash: complete: echo: no completion specification
$ alias gvi='gvim --remote-silent'
msw@tallguy:~/.gnupg$ complete -p gvi
bash: complete: gvi: no completion specification

Where did complete -o filenames -F _filedir_xpec gv come from?

© Super User or respective owner

Related posts about bash

Related posts about autocomplete