且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

可以在zsh中使用Bash制表符完成脚本吗?

更新时间:2023-10-03 14:37:34

来自此页面(日期为2010/01/05):

From this page (dated 2010/01/05):

Zsh可以处理bash补全功能. zsh的最新开发版本具有bashcompinit函数,该函数在运行时将允许zsh读取bash完成规范和函数.这在zshcompsys手册页中进行了介绍.要使用它,您需要做的就是在compinit之后的任何时间运行bashcompinit.它将定义与bash内置程序相对应的complete和compgen函数.

Zsh can handle bash completions functions. The latest development version of zsh has a function bashcompinit, that when run will allow zsh to read bash completion specifications and functions. This is documented in the zshcompsys man page. To use it all you need to do is run bashcompinit at any time after compinit. It will define complete and compgen functions corresponding to the bash builtins.