Use typeset -g with precmd_functions

This makes it possible to use `eval "$(pyenv virtualenv-init -)"` from a
function.
This commit is contained in:
Daniel Hahler
2015-03-14 02:37:14 +01:00
parent 32e5a73345
commit 2ab9483116
2 changed files with 2 additions and 2 deletions

View File

@@ -144,7 +144,7 @@ EOS
;; ;;
zsh ) zsh )
cat <<EOS cat <<EOS
typeset -a precmd_functions typeset -g -a precmd_functions
if [[ -z \$precmd_functions[(r)_pyenv_virtualenv_hook] ]]; then if [[ -z \$precmd_functions[(r)_pyenv_virtualenv_hook] ]]; then
precmd_functions+=_pyenv_virtualenv_hook; precmd_functions+=_pyenv_virtualenv_hook;
fi fi

View File

@@ -113,7 +113,7 @@ _pyenv_virtualenv_hook() {
fi fi
fi fi
}; };
typeset -a precmd_functions typeset -g -a precmd_functions
if [[ -z \$precmd_functions[(r)_pyenv_virtualenv_hook] ]]; then if [[ -z \$precmd_functions[(r)_pyenv_virtualenv_hook] ]]; then
precmd_functions+=_pyenv_virtualenv_hook; precmd_functions+=_pyenv_virtualenv_hook;
fi fi