I'm reasonably certain that the zsh autocompletion system cannot be emulated by bash to any real degree. It's the single most overdesigned autocompletion system I've ever heard of, knocking the socks off bash and even Emacs. Half of it is written in byte-compiled zsh script, and a description of it occupies half the zsh manual, over 200 pages!
(But it is seriously awesome despite the ridiculous overdesign.)
Posted Dec 8, 2011 14:50 UTC (Thu) by nye (guest, #51576)
[Link]
>I'm reasonably certain that the zsh autocompletion system cannot be emulated by bash to any real degree
Can you give an example of the kind of autocompletion that can be done in zsh but not in bash?
Evolution of shells in Linux (developerWorks)
Posted Dec 8, 2011 16:44 UTC (Thu) by nix (subscriber, #2304)
[Link]
You can ask for 'fuzzy completion of each element of a directory separately, displaying completion output in one of several types of menu, grouped by type of entry (e.g. option -- automatically determined from --help output -- versus filename versus directory versus USENET group name versus file descriptor number versus a million other things), with the appearance of each type independently changeable, not duplicating autocompletion entries in a single command if and only if the command is rm, doing spelling correction on directories matching this glob but only for this subset of commands' if you like. And that's just one example I happen to be using.
bash has nothing remotely comparable.
It is *crazy* flexible, so flexible that there is an autoloaded 'compinit' function just so that normal mortals stand a chance of configuring its *default* setup. (This is the 'zshcompsys' completion system, btw, not the 'zshcompctl' system, which is akin to bash's, and is obsolete.)
Evolution of shells in Linux (developerWorks)
Posted Dec 8, 2011 15:48 UTC (Thu) by joey (subscriber, #328)
[Link]
The autoloading of completions on demand is the only reason I still use zsh. When I configured bash to load all completions, starting a shell took enough time to be annoying.
Evolution of shells in Linux (developerWorks)
Posted Dec 14, 2011 0:01 UTC (Wed) by tertium (subscriber, #56169)
[Link]
Then you might find this useful: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=467231 (disclaimer: I'm the original reporter). The script still works fine for me, I only added "declare -p bash4 2>/dev/null" when upgraded to bash 4.
Evolution of shells in Linux (developerWorks)
Posted Dec 8, 2011 23:34 UTC (Thu) by nevyn (subscriber, #33129)
[Link]
Can bash do the auto-complete cycling thing that zsh does?
That's probably at least 50% of the reason I still use zsh, the other 90% being that I configured zsh like 16 years ago and am happy to not have to configure bash when "yum install zsh" works instead :).
RPROMPT is nice too though ;).