X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=0a15eb27a363dbcbec699a75743521a1c2b1141f;hb=20a83b08a64ef033ac0a2b5aedcbe4af2b4fd3ee;hp=b864606487e000d6ed201eb622e704e217c4768a;hpb=4b01bc675c8e23510ca5245c8274a338479c1b35;p=grml-etc-core.git 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 } # }}}