Restricted tab-completion is annoying

Gavin Panella gavin.panella at
Thu Oct 11 09:20:12 UTC 2007

Try with the following in your ~/.bashrc:

   shopt -u progcomp

That turns off Programmable Completion (see the section in bash man  
page for more) and leaves you (well, it leaves me) with the "normal"  
file-based tab-completion.

Actually, I'm a fan of programmable completion, but I don't like most  
of the rules that are added by /etc/bash_completion. I think they  
are, as you've found, confusing and too prescriptive. I just have a  
few rules which are set in my ~/.bashrc. If you want to go that  
route, then use instead:

   complete -r

That will clear the list of completions before you add your own.


On 10 Oct 2007, at 22:23, Aaron C. de Bruyn wrote:

> Today a website generated a PDF file for me automatically and  
> firefox popped up and asked if I wanted to download it.  I hit 'OK'  
> and it saved 'genpdf.asp' into my downloads folder.  I was  
> surprised to find bash wouldn't tab-complete the filename.
> Apparently there is new (newer than dapper) bash completion code  
> that restricts completed files based on the initial part of the  
> command.  (/etc/bash_completion)
> I think this sucks.  I spend a lot of time at the bash prompt and  
> use tab-completion constantly.  When you are in bash, I would  
> expect you sorta know what you are doing.
> One example of where I *will* have issues is if I upgrade my home  
> media server from Dapper to Gutsy.
> It stores all the video from my camcorder, copies of all my CDs and  
> DVDs, pictures from digital cameras, etc...
> Most of the files don't have an extension because file extensions  
> are sorta useless in Linux.
> If I upgrade to Gutsy it appears I won't be able to type in  
> 'mplayer StarTrek-Wrath<TAB>' and have it fill in 'StarTrek- 
> Wrath_of_Kahn'.
> So I guess I have two questions
> * Why does the tab-completion code that restricts based on command- 
> names exist?  What benefit does this restriction have to power users??
> * If it's here to stay, what is the official 'ubuntu way' to  
> disable it for people who don't like it.  It appears /etc/ 
> bash_completion is owned by the bash package.  If I upgrade bash,  
> will it come back?  I want it off my servers and workstations  
> perminantly.  I see nothing in /etc/defaults.
> -A

More information about the Ubuntu-devel-discuss mailing list