[Bash-completion-devel] [bash-completion-Bugs][312825] Bash completion displays incorrect choices when COMPREPLY words contain "/" characters after the longest common prefix

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Sat Nov 13 09:02:35 UTC 2010


Bugs item #312825, was changed at 2010-11-13 02:41 by Ville Skyttä 
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312825&group_id=100114

>Status: Closed
Priority: 3
Submitted By: Nobody (None)
Assigned to: Nobody (None)
Summary: Bash completion displays incorrect choices when COMPREPLY words contain "/" characters after the longest common prefix 
Distribution: Ubuntu
Originally reported in: None
Milestone: None
>Status: Invalid
Original bug number: 


Initial Comment:
Anonymous message posted by tim at gfxmonk.net

I'm using a completion function to complete the argument to `0launch` from a list of known URLs. Given the input 'http://g', my COMPREPLY array contains the following array (each line is an element):
http://gfxmonk.net/dist/0install/appengine-auth.xml
http://gfxmonk.net/dist/0install/dbus-python.xml
http://git.savannah.gnu.org/cgit/parallel.git/plain/packager/0install/parallel.xml

When I press tab twice, bash shows me the following possible completions (since all options start with what I've already entered):

$ 0launch 'http://g<tab><tab>
    appengine-auth.xml                  dbus-python.xml            parallel.xml

This is not the correct list of completions, it seems to be displaying only the part of each completion after the final "/". If I actually typed the first letter from one of these options, it would be wrong (and would not complete any further).

Note that there seems to be nothing wrong with the contents of the COMPREPLY array itself, as when I type:

$ 0launch 'http://gf<tab>

It successfully completes the argument to the longest common prefix, which is 'http://gfxmonk.net/dist/0install/

Bash version: 1:1.2-2ubuntu1


----------------------------------------------------------------------

>Comment By: Ville Skyttä  (scop-guest)
Date: 2010-11-13 11:02

Message:
There is no 0launch completion in bash-completion, and you didn't show us the completion function you're using so we can't tell if it's using any bash-completion stuff (i.e. stuff from *this* particular project), so I'm closing this as invalid as it doesn't seem to be a bash-completion (again *this* particular project) bug.

My crystal ball tells me that you should probably check that you do *not* specify -o filenames in your "complete" line for 0launch nor turn -o filenames on inside your completion function where it returns those URLs.

----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=312825&group_id=100114



More information about the Bash-completion-devel mailing list