我正在尝试使用oh-my-zsh git-flow插件并收到以下错误。
➜ ~/www/ git:(develop) git flow feature feature
flags:FATAL zsh shwordsplit option is required for proper zsh operation
这是插件的问题吗?还是配置问题?
编辑:使用setopt shwordsplit
无效
➜ ~/www/ git:(develop) ✗ setopt shwordsplit
➜ ~/www/ git:(develop) ✗ git flow feature
flags:FATAL zsh shwordsplit option is required for proper zsh operation
编辑2:使用set -x
(k3)➜ ~ git flow feature
+_per-directory-history-addhistory:1> print -sr -- git flow feature
+_per-directory-history-addhistory:2> fc -p /home/gaurav/.directory_history/home/gaurav/history
+_per-directory-history-addhistory:1> print -sr -- git flow feature
+_per-directory-history-addhistory:2> fc -p /home/gaurav/.directory_history/home/gaurav/history
+_per-directory-history-addhistory:1> print -sr -- git flow feature
+_per-directory-history-addhistory:2> fc -p /home/gaurav/.directory_history/home/gaurav/history
+_per-directory-history-addhistory:1> print -sr -- git flow feature
+_per-directory-history-addhistory:2> fc -p /home/gaurav/.directory_history/home/gaurav/history
+_per-directory-history-addhistory:1> print -sr -- git flow feature
+_per-directory-history-addhistory:2> fc -p /home/gaurav/.directory_history/home/gaurav/history
+omz_termsupport_preexec:1> emulate -L zsh
+omz_termsupport_preexec:2> setopt extended_glob
+omz_termsupport_preexec:3> local 'CMD='
+omz_termsupport_preexec:4> title '' '%100>...>git flow feature%<<'
+title:1> [[ '' == true ]]
+title:1> [[ '' == *term* ]]
+title:4> [[ xterm == screen* ]]
+title:6> [[ xterm == xterm* ]]
+title:7> print -Pn '\e]2;%100\>...\>git\ flow\ feature%\<\<\a'
+title:8> print -Pn '\e]1;\a'
+/usr/bin/zsh:1310> git flow feature
flags:FATAL zsh shwordsplit option is required for proper zsh operation
+omz_termsupport_precmd:1> title '%15<..<%~%<<' %n@%m: '%~'
+title:1> [[ '' == true ]]
+title:1> [[ '' == *term* ]]
+title:4> [[ xterm == screen* ]]
+title:6> [[ xterm == xterm* ]]
+title:7> print -Pn '\e]2;%n@%m:\a'
+title:8> print -Pn '\e]1;%15\<..\<%~%\<\<\a'
+/usr/bin/zsh:1311> git_prompt_info
+git_prompt_info:1> ref=+git_prompt_info:1> git symbolic-ref HEAD
+git_prompt_info:1> ref=''
+git_prompt_info:1> return
编辑2:有关设置的更多信息
(k3)➜ K3 git:(feature/ebay_listings) ls -l /bin/sh
lrwxrwxrwx 1 root root 12 Oct 7 22:12 /bin/sh -> /usr/bin/zsh
(k3)➜ K3 git:(feature/ebay_listings) ls -l /usr/bin/zsh
lrwxrwxrwx 1 root root 28 Oct 2 13:49 /usr/bin/zsh -> /etc/alternatives/zsh-usrbin
(k3)➜ K3 git:(feature/ebay_listings) ls -l /bin/zsh
lrwxrwxrwx 1 root root 21 Oct 2 13:49 /bin/zsh -> /etc/alternatives/zsh
(k3)➜ K3 git:(feature/ebay_listings) ls -l /etc/alternatives/zsh-usrbin
lrwxrwxrwx 1 root root 9 Oct 2 13:49 /etc/alternatives/zsh-usrbin -> /bin/zsh4
(k3)➜ K3 git:(feature/ebay_listings) ls -l /bin/zsh4
-rwxr-xr-x 1 root root 688656 Mar 30 2012 /bin/zsh4
(k3)➜ K3 git:(feature/ebay_listings) ls -l /etc/alternatives/zsh
lrwxrwxrwx 1 root root 9 Oct 2 13:49 /etc/alternatives/zsh -> /bin/zsh4
(k3)➜ K3 git:(feature/ebay_listings) /bin/sh -c 'echo $0 B$BASH_VERSION Z$ZSH_VERSION'
/bin/sh B Z4.3.17
答案 0 :(得分:1)
错误消息中完全解释了配置问题:
正确的zsh操作需要zsh shwordsplit选项
。您必须将setopt shwordsplit
添加到zshrc。如果你让git-flow作者相信这个选项不方便,那就更好了:如果var是标量,则设置command $var
可以导致使用任意数量的参数调用命令(取决于有多少空格/制表符/换行符)字符串),你必须输入command "$var"
。没有:有一个,等于$var
。