Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 185303 - app-shells/bash-completion-20060301 - Hitting "tab" after typing "tar xvzf " or "tar -xvzf " results in an error instead of completion
Summary: app-shells/bash-completion-20060301 - Hitting "tab" after typing "tar xvzf " ...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Shell Tools project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-14 14:42 UTC by jorges
Modified: 2007-07-14 16:14 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jorges 2007-07-14 14:42:24 UTC
Bash-completion: Hitting "tab" after typing "tar xvzf " or "tar -xvzf " results in an error instead of completion.
If the "f" option is separated from the others by a blank, then the completion is successful.

Reproducible: Always

Steps to Reproduce:
1.Type "tar xvzf " or "tar -xvzf "
2.Hit "tab"
3.

Actual Results:  
$ tar xvzf bash: no match: t?(ar.)@(gz|Z)

Expected Results:  
Completion in case of a single tar file, or a list where there are multiple tar files.

GNU bash, version 3.2.15(1)-release (x86_64-pc-linux-gnu)
app-shells/bash-completion-20060301
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-07-14 14:50:21 UTC
I cannot reproduce this at all...

$ tar xvzf <tab><tab>
Display all 382 possibilities? (y or n)
Comment 2 jorges 2007-07-14 15:47:55 UTC
(In reply to comment #1)
> I cannot reproduce this at all...
> 
> $ tar xvzf <tab><tab>
> Display all 382 possibilities? (y or n)
> 
Well, if I remove everything from my .bashrc except for the bash completion stuff it works. There must be something there that's causing the problem. When I isolate the cause I'll comment back.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-07-14 15:51:26 UTC
Well, you should set anything else (aliases etc.) *after* sourcing /etc/profile.d/bash-completion; anyway, your local stuff in .bashrc is not a bash-completion bug. :)
Comment 4 jorges 2007-07-14 16:09:45 UTC
(In reply to comment #3)
> Well, you should set anything else (aliases etc.) *after* sourcing
> /etc/profile.d/bash-completion; anyway, your local stuff in .bashrc is not a
> bash-completion bug. :)
> 

Actually *everything* is set after sourcing /etc/profile.d/bash-completion, as per instructions on the bash-completion ebuild.

I found the reason of this problem. I had:

shopt -s failglob

in my .bashrc. Removing this line results in the correct behaviour. The people responsible for bash-completion should tell if this is a bug or not, but at least there is conflict between a shell option and bash-conpletion. Anyway, if this is normal, expected, or unavoidable, it would be fine to let users know that this option might mess up bash completion.   

jorges


Comment 5 Jakub Moc (RETIRED) gentoo-dev 2007-07-14 16:14:46 UTC
man bash:

<snip>
failglob
If set, patterns which fail to match filenames during pathname expansion result in an expansion error.
</snip>

Well, then don't complain about this, because it's a bash feature you've turned on.