I would like to have 2 different behavior of "tab" depending of the usage context.
I would like to have the default behavior of bind '"\t":complete' any time except when users are trying to complete arguments of the "mybashfunction" command. In this case I call a special function to generate the completion, but I would like "tab" to work like if bind '"\t":menu-complete' was set.
Tell me more
×
Server Fault is a question and answer site for
professional system and network administrators. It's 100% free, no registration required.
|
|
|||
|
|
|
I believe that its readline library will only support one kind of tab-completion behaviour at a time. |
|||
|
|
|
Is this what you're looking for? http://serverfault.com/questions/48671/bash-menu-complete-only-for-few-matches/52103#52103 |
||||
|
|
You can achieve this by using bash complete rules ...
This won't touch bash's normal completion but when you tab complete myfunc you'll have "zero one two" as possible completions. Edit: oh yeah, jam this into your bashrc or similar so it's sourced in new shells. |
||||
|