no tab completion on path that contains a space

Bug #419509 reported by sam tygier
116
This bug affects 18 people
Affects Status Importance Assigned to Milestone
bash-completion (Debian)
Fix Released
Unknown
bash-completion (Ubuntu)
Fix Released
Low
Unassigned
Karmic
Fix Released
Low
Unassigned

Bug Description

Binary package hint: bash-completion

when typing a path tab completion fails if is a space in the path so far.

setup:
sam@oberon:/tmp$ mkdir foo\ foo
sam@oberon:/tmp$ touch foo\ foo/bar

now do
sam@oberon:/tmp$ cat fo<TAB>
gives
sam@oberon:/tmp$ cat foo\ foo/
now press tab again.

this should expand to
sam@oberon:/tmp$ cat foo\ foo/bar
but instead it does nothing

ProblemType: Bug
Architecture: amd64
Date: Wed Aug 26 22:27:08 2009
DistroRelease: Ubuntu 9.10
Package: bash-completion 1:1.0-3
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-7.27-generic
SourcePackage: bash-completion
Uname: Linux 2.6.31-7-generic x86_64

Revision history for this message
sam tygier (samtygier) wrote :
Changed in bash-completion (Ubuntu):
status: New → Confirmed
tags: added: regression-potential
tags: removed: amd64
Revision history for this message
Alan Bell (alanbell) wrote :

confirmed working fine in Jaunty, confirmed broken as described in Karmic.

Revision history for this message
hikaricore (hikaricore) wrote :

Glad it's not just me, thought I was losing my mind or my tab key was flaking out or something. >.<

Revision history for this message
knarf (launchpad-ubuntu-f) wrote :

Broken in Karmic here as well, seems to coincide with the introduction of bash 4.

To get tab completion working again I used a relatively ancient version of /etc/bash_completion (RELEASE: 20060301) in combination with the existing /etc/bash_completion.d directory. This file (which comes from an earlier Ubuntu-release, ask me not which as I found it as /etc/bash_completion.ucf-old indicating it was replaced sometime in the past by the ucf (man 1 ucf) program on a machine which has not seen a clean install since 6.04) seems to work OK, it might not offer all the niceties (whatever those may be) of more recent bash completion developments but it works with spaces...

The file is attached to this message. You know the standard drill about using script/program files you download from the net... do a diff -u between the current version of /etc/bash_completion and this one to see what changed... to use this file just copy it to /etc/bash_completion after moving the original /etc/bash_completion to /etc/bash_completion.org or something similar.

Revision history for this message
Munzir Taha (منذر طه) (munzirtaha) wrote :

I have the same bug also and just found if I used backslash before the command it works. e.g
munzir@dv6:~$ \cat foo\ foo/<TAB>
works!

Revision history for this message
Daniel W. Green (octoberdan-gmail) wrote :

In Karmic, I am experiencing the same issue as described. I did not have this issue before I upgraded from Jaunty to Karmic.

Munzir Taha's wonderful workaround works for me.

Revision history for this message
Nicolas Valcarcel (nvalcarcel) wrote :

i've experienced the same problem with #
$ less \#ubuntu-<tab><tab>
#ubuntu-motu #ubuntu-server
$ less \#ubuntu-m<tab> <--- nothing happens

I think the problem is that bash-completion isn't reading escaped characters correctly.

Revision history for this message
Robbie Williamson (robbiew) wrote :

Odd...as I'm not seeing this problem at all on my Karmic install.

Revision history for this message
Robbie Williamson (robbiew) wrote : apport-collect data

Architecture: amd64
DistroRelease: Ubuntu 9.10
Package: bash-completion 1:1.0-3ubuntu1
PackageArchitecture: all
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, user)
 LANG=en_US.UTF-8
ProcVersionSignature: Ubuntu 2.6.31-11.36-generic
Uname: Linux 2.6.31-11-generic x86_64
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Revision history for this message
Robbie Williamson (robbiew) wrote : Dependencies.txt
tags: added: apport-collected
Revision history for this message
Robbie Williamson (robbiew) wrote :

Please update to Beta and verify this bug still exists.

Changed in bash-completion (Ubuntu Karmic):
importance: Undecided → Low
status: Confirmed → Incomplete
Revision history for this message
John Lenton (chipaca) wrote : Re: [Bug 419509] Re: no tab completion on path that contains a space

On Fri, Oct 02, 2009 at 04:15:00PM -0000, Robbie Williamson wrote:
> Please update to Beta and verify this bug still exists.
>
> ** Changed in: bash-completion (Ubuntu Karmic)
> Importance: Undecided => Low
>
> ** Changed in: bash-completion (Ubuntu Karmic)
> Status: Confirmed => Incomplete
>

yes, I can confirm it's still broken.

If I start bash without the bash-completion, it works:

    $ bash --norc
    bash-4.0$ ls Ubuntu\ One/<TAB>
    060428-bagger288-garzweiler.jpg Shared With Me@
    Pics/ stats/

but if in that same shell I load in the completion,

    bash-4.0$ . /etc/bash_completion
    bash-4.0$ ls Ubuntu\ One/<TAB>

completion stops working.

 status confirmed

Revision history for this message
John Lenton (chipaca) wrote :

yes, I can confirm it's still broken.

If I start bash without the bash-completion, it works:

    $ bash --norc
    bash-4.0$ ls Ubuntu\ One/<TAB>
    060428-bagger288-garzweiler.jpg Shared With Me@
    Pics/ stats/

but if in that same shell I load in the completion,

    bash-4.0$ . /etc/bash_completion
    bash-4.0$ ls Ubuntu\ One/<TAB>

completion stops working.

Changed in bash-completion (Ubuntu Karmic):
status: Incomplete → Confirmed
Changed in bash-completion (Debian):
status: Unknown → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bash-completion - 1:1.0-3ubuntu2

---------------
bash-completion (1:1.0-3ubuntu2) karmic; urgency=low

  * Backport quote_readline fix for bash 4, since double-quoting for compgen
    is no longer necessary (LP: #419509).

 -- Colin Watson <email address hidden> Mon, 05 Oct 2009 17:28:03 +0100

Changed in bash-completion (Ubuntu Karmic):
status: Confirmed → Fix Released
Changed in bash-completion (Debian):
status: Fix Committed → Fix Released
Revision history for this message
phooky (phooky) wrote :

I am still seeing this in 1:1.0-3ubuntu2. I've taken bash_completion out of my .bashrc to make shells usable again.

Revision history for this message
Adam (ilredil) wrote :

Still broken in Karmic with the latest version of bash-completion. I tried putting the file from comment #4 in /etc/bash_completion.d/ and when I launched a new terminal it just hung and never got to a point where I could enter any commands.

Revision history for this message
Alexey Kotlyarov (koterpillar) wrote :

Works for me, and I do have bash_completion installed and enabled in .bashrc.

Revision history for this message
sam tygier (samtygier) wrote :

seems fixed for me. adam could you try making a new user account and see if it affected?

Revision history for this message
Adam (ilredil) wrote :

Hmm, seems to be working now. Maybe I just had to log out and then log back in or something. I thought opening a new terminal would be good enough. At any rate, I'm glad to have my tab-completion back. :-)

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

I'm reopening this bug cause of I cannot complete sudo mount if label of the usb key contains a space.

Step to reproduce:
Mount a key with a label lihke "foo foo"

type:

sudo umount /media/foo<TAB>

this command doesn't show
/media/foo\ foo

Changed in bash-completion (Ubuntu):
status: Fix Released → New
Changed in bash-completion (Ubuntu Karmic):
status: Fix Released → New
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

Nobody answer me?

Revision history for this message
Philip Muškovac (yofel) wrote :

I can't test karmic, but your unmount example works just fine on lucid.

Changed in bash-completion (Ubuntu):
status: New → Fix Released
Changed in bash-completion (Ubuntu Karmic):
status: New → Fix Released
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.