Bash-completion fails to parse spaces for umount
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| bash-completion (Ubuntu) |
Undecided
|
Unassigned |
Bug Description
Binary package hint: bash
This should be an easy one - When a mount point is created with a space in the name (in my case "SANSA CLIP"), bash auto-completion fails at the space.
umount /media/SANSA[TAB] yields "umount /media/SANSA " (note the space, but the lack of a complete path).
Seems to be isolated to umount, but may not be.
Thanks,
Sean Crago
aka MrZaius
:::::::
Versioning info:
cragos@
Description: Ubuntu 9.04
Release: 9.04
cragos@
bash --version
GNU bash, version 3.2.48(1)-release (i486-pc-linux-gnu)
cragos@
apt-cache policy bash
bash:
Installed: 3.2-5ubuntu1
Candidate: 3.2-5ubuntu1
Version table:
*** 3.2-5ubuntu1 0
500 http://
100 /var/lib/
affects: | bash (Ubuntu) → bash-completion (Ubuntu) |
MrZaius (cragos) wrote : | #1 |
tags: | added: jaunty lucid |
mnvl16 (mnvl16) wrote : | #2 |
The patch below fixed this for me on karmic, hope it helps.
--- /etc/bash_
+++ bash_completion 2010-11-20 10:07:56.150837242 +0000
@@ -831,8 +831,13 @@
}
complete -F _chgrp $filenames chgrp
-# umount(8) completion. This relies on the mount point being the third
-# space-delimited field in the output of mount(8)
+# umount(8) completion. The mount point should be the third
+# space-delimited field in the output of mount(8), however it
+# can itself contain spaces like any other filename of course.
+# The first two calls to 'sed' strip away the two preceding
+# and three following space-delimited fields
+# It might fail if any OTHER field except the mount point
+# contained a space, however it appears this does not happen.
#
_umount()
{
@@ -841,7 +846,7 @@
COMPREPLY=()
cur=`_get_cword`
- COMPREPLY=( $( compgen -W '$( mount | cut -d" " -f 3 )' -- $cur ) )
+ COMPREPLY=( $( compgen -W '$( mount |sed '\''s/ type [^ ]* [^ ]*$//'\'' | sed '\''s/^[^ ]* on //'\'' | sed '\''s/ /\\ /g'\'' )' -- $cur ) )
return 0
}
Changed in bash-completion (Ubuntu): | |
status: | New → In Progress |
Clint Byrum (clint-fewbar) wrote : | #3 |
Tagging patch, changing status to Confirmed from In Progress. Subscribing ubuntu review team.
Changed in bash-completion (Ubuntu): | |
status: | In Progress → Confirmed |
tags: | added: patch |
kroq-gar78 (kroq-gar78) wrote : | #4 |
Can't confirm this problem with Ubuntu 12.04 because I have the issue in bug 470037 instead
Andreas L (avl42) wrote : | #5 |
adding info from https:/
Problem is that apparently it is using the plain "umount"-completion rather than the "umount.linux"
If I source /usr/share/
Maybe packagers for linux-distributions are supposed to divert umount to umount.linux?
Still present in Lucid.