On Tue, Mar 15, 2011 at 11:14:09AM +0000, Federico G. Schwindt wrote:
> On Tue, Mar 15, 2011 at 01:00:30PM +0200, Paul Irofti wrote:
> > On Tue, Mar 15, 2011 at 06:47:22AM -0400, Okan Demirmen wrote:
> > > On Tue 2011.03.15 at 12:19 +0200, Paul Irofti wrote:
> > > > On Tue, Mar 15, 2011 at 04:45:43AM -0400, Okan Demirmen wrote:
> > > > > hi,
> > > > > 
> > > > > (this is a re-post)
> > > > > 
> > > > > make tab completion work for '=', '`', '[', ':', and '$' - pulled from
> > > > > mksh by Alexander Polakov (also posted to tech recently).
> > > > 
> > > > This diff doesn't work for me with files containing '['. This is the
> > > > first character I tested and it failed.
> > > > 
> > > > 
> > > > $ touch "[this] file.txt"
> > > > $ cat [<TAB> <--- nothing
> > > 
> > > You still need to escape these characters.
> > > 
> > > cat \[<TAB> <-- should now work.
> > 
> > Okay, tested with all the characters and it works.
> > 
> > After reading the diff it looks okay to me, but take into consideration
> > that I'm not well aquainted with this part of the tree and I'm biased
> > because I really want to have this functionality in ksh!
> 
>   this is what the diff is really fixing. escaping of []'s already works
> as long as [ is not the first character, even if it's escaped.

No it does not. If you have a [ somewhere inside a filename the
completion stops there.

BEFORE:
$ touch "this [is] it"
$ touch "this [isn't] it"
$ cat th<TAB> -> this\ \[is 

Now type 'n':

$ cat this\ \[isn<TAB> <- nothing happens


AFTER:
$ touch "this [is] it"
$ touch "this [isn't] it"
$ cat th<TAB> -> this\ \[is 

Now type 'n':

$ cat this\ \[isn\'t\]\ it

This is good to have in the tree in the year of our lord two thousand
eleven.

>   i'd like to see this but without the need to escape [ to be honest.

I don't think that's possible due to the stupidity of the '[' executable.

Reply via email to