From 15081fe001484b3337b60d0874d7ff4f608c1cc8 Mon Sep 17 00:00:00 2001 From: Richard Hartmann Date: Tue, 24 May 2011 23:46:16 +0200 Subject: [PATCH] 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. --- vcsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.39.2