Bug 622655 - shopt -s failglob breaks bash-completion
Summary: shopt -s failglob breaks bash-completion
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: bash-completion
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-08-10 04:46 UTC by Sean Flanigan
Modified: 2018-09-15 01:49 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-11-25 22:02:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Sean Flanigan 2010-08-10 04:46:00 UTC
Description of problem:
Enabling the shell option failglob causes completion to fail with the error message "no match". 

Version-Release number of selected component (if applicable):
1:bash-completion-1.2-2.fc13.noarch
bash-4.1.7-1.fc13.i686

How reproducible:
Every time

Steps to Reproduce:
1. # yum install bash-completion
2. shopt -s failglob
3. cvs c<TAB>
  
Actual results:
bash: no match: words[0]=${!ref}${COMP_WORDS[i]}

Expected results:
checkout  commit

Additional info:

Comment 1 Ville Skyttä 2010-09-28 20:45:49 UTC
Discussing upstream:
http://thread.gmane.org/gmane.comp.shells.bash.completion.devel/2546

Comment 3 Ville Skyttä 2010-11-25 22:02:54 UTC
http://wiki.debian.org/Teams/BashCompletion/Proposals/Roadmap

Also in upstream roadmap for version 3.0.  It will take a while until we get there, so closing UPSTREAM.

Comment 4 Jean-Baptiste Poittevin 2012-10-21 18:18:12 UTC
Two years after, bug is still there (fedora17/bash-completion-2.0-1.fc17.noarch)

For those who encountered same bug, here is an ugly workaround for ugly code :

bash_completion:281
__reassemble-comp_words_by_ref

            # Append word to current word
            #BEGIN HACK
            if shopt failglob >/dev/null; then
                INVERTGLOB=1
                shopt -u failglob
            else
                INVERTGLOB=0
            fi
            #END HACK
            eval $2[$j]=\${!ref}\${COMP_WORDS[i]}
            #BEGIN HACK
            if [ $INVERTGLOB -eq 1 ]; then

Comment 5 Jean-Baptiste Poittevin 2012-10-21 18:19:55 UTC
                shopt -s failglob
            fi
            #END HACK
            # Remove optional whitespace + word from line copy


Note You need to log in before you can comment on or make changes to this bug.