Hi Jonathan,

On 2012-05-22 19:06:21 -0500, Jonathan Nieder wrote:
> Vincent Lefevre wrote:
> 
> [...]
> > And if I do
> >
> > $ echo :0[TAB]
> >
> > then bash tries to complet on the files that start with "0".
> 
> I think this is by design.  The manual tells me:
> 
>       COMP_WORDBREAKS
>               The set of characters that the readline library
>               treats as word separators when performing word
>               completion.
> 
> The default value of COMP_WORDBREAKS is $" \t\"'@><=;|&(:." (that's
> space, tab, dq, sq, at, gt, lt, eq, ...).

The default value is here different:

$ echo $COMP_WORDBREAKS
"'><=;|&(:

(I think yours is buggy because you definitely don't want the dot to
be part of $COMP_WORDBREAKS, as many filenames have a dot in them.)

> This ensures that tab completion will do the right thing for
> commands like
> 
>       PATH=/usr/bin:/foo/ba[TAB]

zsh works fine with both kinds of completion, but...

> without requiring any logic more complicated than the word splitting
> rules already built in to readline.

it has a more advanced completion system. However I think that
bash could "easily" be improved: IMHO, $COMP_WORDBREAKS should
be taken into account only if [TAB] wouldn't find any match
without $COMP_WORDBREAKS.

> One can use
> 
>       echo \:0[TAB]
> 
> when a colon should be considered part of a path.

Thanks, this works.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to