wishlist: bash completion could do better with umount with spaces

Bug #655488 reported by Anthony Godshall
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: bash-completion

For example, with a common USB drive that mounts as "/media/My Passport" ...

# mount|grep sdb1
/dev/sdb1 on /media/My Passport type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1999,gid=1999,shortname=mixed,dmask=0077,utf8=1,flush)
# umount /media/My

The tab-complete stops at My and doesn't escape the space or put quotes around.

The recipe for rsync does the right thing...
# rsync /media/My\ Passport/

The place for the improvement would appear to be in this snipped of /etc/bash_completion:

     _umount()
    {
        local cur IFS=$'\n'

        COMPREPLY=()
        cur=`_get_cword`

        COMPREPLY=( $( compgen -W '$( mount | cut -d" " -f 3 )' -- "$cur" ) )

        return 0
    }
    complete -F _umount $dirnames umount

... but I don't know what it would be or I'd write and include a patch.

Tony

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: bash-completion 1:1.1-3ubuntu2
ProcVersionSignature: Ubuntu 2.6.32-24.41-generic 2.6.32.15+drm33.5
Uname: Linux 2.6.32-24-generic i686
NonfreeKernelModules: wl
Architecture: i386
Date: Tue Oct 5 22:20:03 2010
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: bash-completion

Revision history for this message
Anthony Godshall (agodshall) wrote :
Revision history for this message
Eliah Kagan (degeneracypressure) wrote :

I am unable to reproduce this bug on a Maverick amd64 system running bash 4.1-2ubuntu4 and bash-completion 1:1.2-2ubuntu1.

When you type "umount /media/My" (with no trailing space) and then press tab, does it do nothing, or does it add an unescaped trailing space? If it appends a space (without a backslash), then I think this should be considered a bug, and not just a wishlist item.

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.