[Bug 1095180] Re: incorrect bash-completion for sudo

Peter Cordes peter at cordes.ca
Sat Nov 29 08:42:54 UTC 2014


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.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bash-completion in Ubuntu.
https://bugs.launchpad.net/bugs/1095180

Title:
  incorrect bash-completion for sudo

Status in bash-completion package in Ubuntu:
  Confirmed
Status in etckeeper package in Ubuntu:
  Confirmed

Bug description:
  bash-completion in precise is faulty

  $ cd /etc
  $ sudo etckeTAB

  that completes to

  $ sudo etckeeper/

  when it should complete only to

  $ sudo etckeeper

  ------
  Notes from comments:

  Original report:
  Release: Ubuntu Precise 12.04
  Package Version: etckeeper 0.61ubuntu2

  Additionally confirmed on (by teward):
  Release: Ubuntu Quantal 12.10
  Package Version: etckeeper 0.61ubuntu2

  Additionally confirmed on (by teward):
  Release: Ubuntu Raring 13.04 - Daily Image from 2013-01-04
  Package Version: etckeeper 0.61ubuntu2

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1095180/+subscriptions



More information about the foundations-bugs mailing list