[Bash-completion-devel] Directory name completion fails if name contains spaces and is quoted

David Paleino d.paleino at gmail.com
Sun May 11 16:00:55 UTC 2008


On Sun, 11 May 2008 17:26:34 +0200, David Paleino wrote:

> On Fri, 02 May 2008 13:22:11 +0900, Morita Sho wrote:
> 
> > The function _get_cword() returns the current word that cursor is pointed.
> > The problem is, _get_cword considers only \ quoting, not considers " or '
> > quoting. So that, _get_cword thinks the word  "foo b  is 2 words, '"foo' and
> > 'b'. That is a reason why " or ' quoting not work although \ quoting works.
> > 
> > 
> > I have 2 ideas to fix the problem. [..]
> 
> Thanks for the report, and thanks Morita for the ideas posted.
> We (the Bash-Completion Team, CCed) have taken upstream development, and we're
> currently working on a new release (which is mainly bug-fix).

I've currently patched _get_cword()... please try to enclose into quotes the
last line of the function:

echo "$cur"

instead of

echo $cur


This works for me (and, yes, it also considers " and ' as quoting characters
now).

Tagging the bug as "pending", waiting for a reply.


Kindly,
David

-- 
 . ''`.  Debian maintainer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://snipr.com/qa_page
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20080511/a9f8b7d1/attachment.pgp 


More information about the Bash-completion-devel mailing list