Open bschlenk opened 7 years ago
@bschlenk Interesting idea! Would the use-case be for using the bish REPL as a shell itself? Or are you thinking that the compiled bash script would register its autocompletion with the user's current shell (similar to Example J-1 in the document you linked)?
PS - you may have noticed, but I haven't had any time to devote to bish for quite a while now. If you'd like to take a crack at implementing this, please do!
I've been thinking of something like this for a while, but I always focused on the idea of automating the autocompletion scripts. It would be really cool to come up with a declarative syntax for defining function arguments that could be compiled into programmable completion in bash.
Here is a contrived example of how a function in bish could be annotated:
This would enable the following behavior:
You can see a real world example of this type of autocompletion with tmux. Start some sessions and type
tmux attach-session -<Tab>
. I'm not sure if it would work to this degree in bash as I've only seen it in zsh, but it does offer some level of programmable autocompletion.