From 20a83b08a64ef033ac0a2b5aedcbe4af2b4fd3ee Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Wed, 26 Mar 2008 11:06:50 +0100 Subject: [PATCH] Disable persistent dirstack for shells older then 4.2.0 We use the (u) flag when saving, which is not available in these older versions of zsh. We do not intent to keep this disabled forever; just until we got a properly working solution for older shells. --- etc/zsh/zshrc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index b864606..0a15eb2 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -928,15 +928,21 @@ isgrmlcd && SAVEHIST=1000 || SAVEHIST=10000 # useful for setopt append_history # dirstack handling {{{ +# TODO: the is42 tests are in place, because (u) requires at least 4.2.0 +# of zsh. We also disable loading potentielly old .zdir files when +# starting a pre-4.2.0 zsh. +# Implementing a workaround-(u) for older shells is the obvious +# solution here, if we want this for all supported shells. + DIRSTACKSIZE=20 -if [[ -f ~/.zdirs ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then +if is42 && [[ -f ~/.zdirs ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then dirstack=( ${(f)"$(< ~/.zdirs)"} ) # "cd -" won't work after login by just setting $OLDPWD, so [[ -d $dirstack[0] ]] && cd $dirstack[0] && cd $OLDPWD fi chpwd() { - builtin print -l ${(u)dirstack} >! ~/.zdirs + is42 && builtin print -l ${(u)dirstack} >! ~/.zdirs } # }}} -- 2.1.4