bash-completion needs match "fallback" function. (supported but upstream doc not packaged)

Bug #484628 reported by Vanessa Dannenberg
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: bash-completion

It would make the most sense if I just given an example. Suppose I have a DVD .ISO file buried a couple levels down in my filesystem, that I want to open with XINE, and I type the following (knowing for certain it will resolve to exactly one match):

xine /ra{tab}dir{tab}som{tab}

It would normally expand to something like:

xine /rainbird/directory/somefile.iso

However, bash-completion prevents this match,probably because it thinks XINE can't play an ISO file. It of course can play them (provided I add "dvd://" in front of the path, after I'm done tabbing)

I think the best bet would be to make bash-completion default to normal, unfiltered filename matches if it can't find a specific filetype in its configuration (equivalent to what you'd get without the package installed at all). I think this would solve a number of other problems such as that mentioned in bug #115224 , bug #127605 , bug #156200 , and probably a number of others.

Alex Lourie (alourie)
Changed in bash-completion (Ubuntu):
status: New → Confirmed
Revision history for this message
Peter Cordes (peter-cordes) wrote :

You can get default completion behaviour (not the special-case stuff) for a command by doing e.g. \xine. \cmd also disables alias expansion.

 The \ just quotes the first letter of the command, but that's enough to disable some stuff that bash would otherwise do.

Revision history for this message
Peter Cordes (peter-cordes) wrote :

another workaround: as /usr/share/doc/bash-completion/README.gz suggests, use M-/ to use bash's builtin filename completion, rather than calling the programmable completion functions. That will complete on any filename, since it doesn't have any command-specific filtering.

Revision history for this message
Peter Cordes (peter-cordes) wrote :

Oh, this is supported and documented in a .txt that the .deb doesn't ship.

simply put
COMP_FILEDIR_FALLBACK=1
in your ~/.bash_completion (or ~/.bashrc)

doc/bash_completion.txt in the source tree.

https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=bash-completion/bash-completion.git;a=blob;f=doc/bash_completion.txt;h=c6e53d4c0534416d2507607ee9a90f1b1dd3abe9;hb=HEAD

 close this bug once Ubuntu ships upstream's doc/bash_completion.txt

summary: - bash-completion needs match "fallback" function
+ bash-completion needs match "fallback" function. (supported but
+ upstream doc not shipped)
summary: bash-completion needs match "fallback" function. (supported but
- upstream doc not shipped)
+ upstream doc not packaged)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.