From: Richard Hartmann Date: Tue, 24 May 2011 21:46:16 +0000 (+0200) Subject: Avoid error when executed by /bin/sh X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/15081fe001484b3337b60d0874d7ff4f608c1cc8?ds=sidebyside;hp=-c Avoid error when executed by /bin/sh No idea why [[ -n $ZSH_VERSION ]] && vcsh_exit() {vcsh exit; zle reset-prompt;} errors out with vcsh: 96: Syntax error: "}" unexpected (expecting "fi") but oh well. --- 15081fe001484b3337b60d0874d7ff4f608c1cc8 diff --git a/vcsh b/vcsh index 5acd515..e3612b7 100755 --- a/vcsh +++ b/vcsh @@ -93,7 +93,12 @@ elif [ "$1" = 'use' ]; then if [[ -o NO_IGNORE_EOF ]]; then export VCSH_NO_IGNORE_EOF=1 setopt IGNORE_EOF - vcsh_exit() {vcsh exit; zle reset-prompt;} + if [[ -n $ZSH_VERSION ]]; then + vcsh_exit() { + vcsh exit; + zle reset-prompt; + } + fi zle -N vcsh_exit bindkey '^d' 'vcsh_exit' fi