zshrc: dirstack: skip for ZSH_SUBSHELL
authorDaniel Hahler <git@thequod.de>
Wed, 4 May 2016 21:37:16 +0000 (23:37 +0200)
committerFrank Terbeck <ft@grml.org>
Fri, 6 May 2016 10:16:17 +0000 (12:16 +0200)
Otherwise `(cd foo)` would add `foo` to the stack, which is probably not
what you would expect.

etc/zsh/zshrc

index c03b614..84d37a9 100644 (file)
@@ -1613,6 +1613,7 @@ if zstyle -T ':grml:chpwd:dirstack' enable; then
     }
 
     chpwd() {
+        (( ZSH_SUBSHELL )) && return
         (( $DIRSTACKSIZE <= 0 )) && return
         [[ -z $DIRSTACKFILE ]] && return
         grml_dirstack_filter $PWD && return