Subject: Re: Tab completion in /bin/sh
To: Eric Haszlakiewicz <>
From: David Laight <>
List: current-users
Date: 05/06/2005 23:48:08
On Fri, May 06, 2005 at 02:40:07PM -0500, Eric Haszlakiewicz wrote:
> On Fri, May 06, 2005 at 06:04:21PM +0100, Chris Wareham wrote:
> > I've started poking through the source for sh(1) and made some notes
> > about the way tab completion works (from the user perspective) in GNU
> > bash. I consider tab completion to be something that should be optional,
> > and only enabled in emacs mode. As noted in another message, tab
> 	It should be an independant option.  Tab completion is just as useful
> for people that use vi mode.

@@ -149,6 +150,12 @@ bad:
                                el_set(el, EL_EDITOR, "vi");
                        else if (Eflag)
                                el_set(el, EL_EDITOR, "emacs");
+                       if (tabcomplete) {
+                               el_set(el, EL_ADDFN, "rl_complete",
+                                   "ReadLine compatible completion function",
+                                   _el_rl_complete);
+                               el_set(el, EL_BIND, "^I", "rl_complete", NULL);
+                       }
                        el_source(el, NULL);
        } else {

to sh/histedit.c almost works (after a few hacks to make some symbols
visible).  But I need to spend another hour or so workign why it isn't


David Laight: