Tab complete with KSH in Emacs mode without bindings
Question
I'm trying to enable auto complete for the command line in emacs mode. When I try:
set -o emacs
bind '^I'=complete
bind '^I'=complete-list
and relog on, I get "bind command not found" error.
Is there any other way to tab-autocomplete in emacs mode, i.e. a tab completes to the first difference? If not, how do I install bindings in ksh?
Thanks
Solution
bind
is Bash/readline-specific.
From the ksh faq,
Q6. Does ksh support file name completion? A6. Yes, it does. The default key binding is <ESC><ESC> however, starting with the 'g' point release, <TAB> also works for completion. Note, the vi users need to set -o viraw in order to get <TAB> completion to work.
ksh93g
was released in 1994-04-30, so I'm quite surprised if it doesn't work for you... what's your ksh
version?
OTHER TIPS
As you found out, key binding was introduced in ksh93,
Q5. What are the major new features of KornShell 1993?
A5. The only major new interactive feature is key binding. ... (KSH-93 FAQ)
In emacs mode, hitting
<ESC>=
gives you a list that matches the text you have typed up to that point.