From aac552362917fc729c80d191dd387016e39f97a0 Mon Sep 17 00:00:00 2001 From: xiao Date: Mon, 3 Aug 2015 22:58:29 -0700 Subject: [PATCH] Additional chpwd clobbering fix for dirpersist --- plugins/dirpersist/dirpersist.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/dirpersist/dirpersist.plugin.zsh b/plugins/dirpersist/dirpersist.plugin.zsh index 88d1129d4..e4590afc6 100644 --- a/plugins/dirpersist/dirpersist.plugin.zsh +++ b/plugins/dirpersist/dirpersist.plugin.zsh @@ -11,7 +11,9 @@ if [[ -f ${dirstack_file} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then [[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD fi -chpwd() { +typeset -ga chpwd_functions +chpwd_functions+='chpwd_dirpersist' +chpwd_dirpersist() { if (( $DIRSTACKSIZE <= 0 )) || [[ -z $dirstack_file ]]; then return; fi local -ax my_stack my_stack=( ${PWD} ${dirstack} )