Request bash completion complete for application when file param has no extension, complete to unrecognised extension if only match.

Bug #692275 reported by Derek
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: bash-completion

I've repeatedly run into this irritating behaviour with bash-completion. Here's a common situation for me.

Flash player is being buggy and playing unreliably. I go to /tmp and try to tab-complete the Flash temp file in mplayer (or in /proc system for new flash which unlinks, whatever).
But that file has no extension so bash completion fails.

Another example. I try to mplayer -loop 0 -fs foo.gif

But bash completion is unaware that gif is playable by mplayer, and refuses to tab complete. inevitably the gif is from some web page and has a name that doesn't copy/paste well, and I could really use bash autoescaping and tab completion.

I'd appreciate it if bash-completion would:
1) complete for files with no extension regardless of app
2) if I tab complete for a file and there is only one match, complete it even if you are unaware of whether the app supports it.
(2) isn't solved by better maintenance of extensions. the gif might be called foo.php and I shouldn't have to rename it.

Thanks!

Revision history for this message
Derek (bugs-m8y) wrote :

Oh. Alternatively, if the magic completion could get a mime/file type from file/gnome-vfs or something, that'd work too I guess, and allow completing on multiple recognised matches.
(assuming it could be done fast enough).

Or.
Just let me turn off that specific feature entirely (checking supported file types).
ssh/scp completion, that's nice. I'd rather not uninstall bash-completion.

Revision history for this message
Derek (bugs-m8y) wrote :

Yeah. Come to think of it, that'd be ideal for me, if bash completion package had feature flag checks.
Like I could put:
ENABLE_FILE_EXTENSION_FILTER=1
or
DISABLE_FILE_EXTENSION_FILTER=1
in my bashrc.

Thanks!

Revision history for this message
Derek (bugs-m8y) wrote :

Another example - when bash completion is unaware of what an mp2 file is - sure a bug is probably needed to add that to its mplayer file extension list, but I'd also like to be able to override this often-irritating feature.

Revision history for this message
Ken Sharp (kennybobs) wrote :

This needs to be filed upstream if it's still an issue

Revision history for this message
Dan Kegel (dank) wrote :

This just hit me when I installed Ubuntu 14.04. Now bash won't complete
   sh name-of-shell-script
unless the shell script ends in .sh.

Filename completion used to be useful, but it's gotten so fancy and fragile...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

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

I put a \ at the beginning of the command to get default filename completion. Or use M-/ instead of tab. But yeah, it would be good for some commands to be flagged to fall back to things that don't match its extension filter.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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