Comment 8 for bug 1095180

Revision history for this message
Peter Cordes (peter-cordes) wrote : Re: incorrect bash-completion for sudo

It's a corner case of a directory in the current directory having the same name as a command. The directory entry is superseding the command completion.

 If you sudo et<tab> you get a list of completions. In /etc, the only entry for etckeeper is with a trailing /, rather than having an entry for the command AND an entry for the directory. If you are cded to somewhere without an etckeeper directory present, etckeeper is fine.

 This happens with completion for any commands flagged to take another command as their first argument. simple testcase:
mkdir apt-g{,et}
nice apt-g<tab> => lists apt-g/ apt-get/
nice apt-ge<tab> => nice apt-get/

Probably fixable without disabling completing filenames as a fallback, IDK. _command_offset() is pretty complex, I'm prob. not going to try to fix it myself.