summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorThomas Luzat <thomas@luzat.com>2023-11-15 12:53:39 +0100
committerCarlo Sala <carlosalag@protonmail.com>2023-11-15 12:54:50 +0100
commitc8e600f39779c6d2ef75b40304b5391a541c41df (patch)
tree733c5d7c4eef105cbb4df869b20d6a167b3accc8 /plugins
parentb6bb133f230847ed0b3f9f4e25f2ceb874ca6c91 (diff)
downloadzsh-c8e600f39779c6d2ef75b40304b5391a541c41df.tar.gz
zsh-c8e600f39779c6d2ef75b40304b5391a541c41df.tar.bz2
zsh-c8e600f39779c6d2ef75b40304b5391a541c41df.zip
fix(direnv): initialize properly direnv
Closes #12038 Closes #12039 Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/direnv/direnv.plugin.zsh6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/direnv/direnv.plugin.zsh b/plugins/direnv/direnv.plugin.zsh
index 6f8debb62..0a33194dd 100644
--- a/plugins/direnv/direnv.plugin.zsh
+++ b/plugins/direnv/direnv.plugin.zsh
@@ -3,14 +3,14 @@ command -v direnv &>/dev/null || return
_direnv_hook() {
trap -- '' SIGINT;
- eval "$(direnv hook zsh)";
+ eval "$(direnv export zsh)";
trap - SIGINT;
}
typeset -ag precmd_functions;
-if [[ -z ${precmd_functions[(r)_direnv_hook]} ]]; then
+if [[ -z "${precmd_functions[(r)_direnv_hook]+1}" ]]; then
precmd_functions=( _direnv_hook ${precmd_functions[@]} )
fi
typeset -ag chpwd_functions;
-if [[ -z ${chpwd_functions[(r)_direnv_hook]} ]]; then
+if [[ -z "${chpwd_functions[(r)_direnv_hook]+1}" ]]; then
chpwd_functions=( _direnv_hook ${chpwd_functions[@]} )
fi