0

我正在尝试使用 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
4

1 回答 1

1

这是错误消息中完全解释的配置问题:

正确的 zsh 操作需要 zsh shwordsplit 选项

. 您必须添加setopt shwordsplit到您的 zshrc。如果您说服 git-flow 作者此选项不方便,则更好:command $var如果 var 为标量,则设置它可能导致使用任意数量的参数调用命令(取决于字符串中有多少空格/制表符/换行符)并且您必须键入command "$var"。没有:有一个,等于$var

于 2012-10-11T16:50:23.333 回答