Are there shell versions that have a more intelligent tab completion?
I'd like to be able to type
cd foo-<TAB>
Then it would show me the possible completions along with numbers that I can type to select one of them:
cd foo-<TAB>
(1) foo-bar1 (2) foo-bar2 (3) foo-bad
So, after <TAB>
I would type 3
and it would take me to foo-bad
. Alternatively, using the arrow keys instead of typing the number would be fine.
Best Answer
You can enable
menu-complete
in Bash to step through the entries on the command line each time you press Tab. This is not really what you're looking for. If you want to try it, do this at the command prompt:To make it persist, add this to your
~/.inputrc
file:Zsh has a feature that allows you to use the arrow keys to select an entry. Add this (or another variation) to your
~/.zshrc
file:See
man zshcompsys
and search for "select=" (it will be in the section for themenu
"Standard Style") for more information.Otherwise, in Bash, you could write a function (or even create your own completion function) that would do something based on the
select
command. This is extremely simplistic:You'd have to flesh that out a lot to get it to do what you want.