Unable to find a substitute command for Bash's complete in Zsh

一个人想着一个人 提交于 2019-12-22 10:35:17

问题


I put the newest git-completion.bash to my .zshrc and I get

/Users/Masi/bin/shells/git/git-completion.bash:2116: command not found: complete
/Users/Masi/bin/shells/git/git-completion.bash:2118: command not found: complete

The lines are

 complete -o bashdefault -o default -o nospace -F _git git 2>/dev/null \
     || complete -o default -o nospace -F _git git 
 complete -o bashdefault -o default -o nospace -F _gitk gitk 2>/dev/null \
     || complete -o default -o nospace -F _gitk gitk

Which command is a substitute for Bash's complete in Zsh?


回答1:


Git's completion script has been updated to work with ZSH too. The latest version should "just work".




回答2:


I do believe it's a problem, since complete is a built-in Bash command. It's part of Bash's programmable completion feature.




回答3:


Bash and Zsh have different completion systems. Using bash completion functions with zsh might be possible, but only though a compatibility layer. I suggest you read man zshcompsys.



来源:https://stackoverflow.com/questions/921186/unable-to-find-a-substitute-command-for-bashs-complete-in-zsh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!