Subject: Re: Tab completion in /bin/sh
To: Tim Jakobsen <tja@jakobsen.vg>
From: Eric Haszlakiewicz <erh@jodi.nimenees.com>
List: current-users
Date: 05/13/2005 13:19:28
On Fri, May 13, 2005 at 11:57:10AM +0200, Tim Jakobsen wrote:
> On Fri, May 13, 2005 at 11:32:08AM +0200, Alan Barrett wrote:
> > There's no way for the shell to know whether you want to expand "/lib"
> > to "/lib/" or to "/libexec/".  The best it can do is to show you a list
> > of possible completions and let you choose.  And it does do that.  So I
> > don't understand what you want to be different.
> 
> That is why I want it to expand it to /lib/ if I eg. continue pretting tab a few times. 

	so why wouldn't it expand to /libexec/ instead?  The shell has no idea
which one you want to expand to.  I don't think you can reasonably have it
guess, even if you cycle through all the choices.  What would continuing
to press tab do, a depth first traversal of everything that starts with
"/lib"?  That seems unlikely to be very useful since it'd take longer than
just typing exactly what you want.

	If you really want something like this I'd suggest defining another
hot key, such as Control-Tab, to mean "pick the next choice at the current
level", so you could type "/lib" then Tab, get a list of choices, then
hit Control-Tab, and the shell would complete it to "/lib/".  From there
you could hit tab to auto-complete within /lib/, or Control-Tab to go to
"/libexec/".

eric