BTS

Message5193

Author ft
Recipients mika
Date 2015-07-20.22:16:08
Content
On IRC, I asked mika for to try this:

diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc
index b6c8375..72fde6e 100644
--- a/etc/zsh/zshrc
+++ b/etc/zsh/zshrc
@@ -1622,7 +1622,7 @@ if [[ -f ${DIRSTACKFILE} ]] && [[ ${#dirstack[*]} -eq 0 ]]
; then
     # directories from the saved dir-stack file.
     dirstack=( ${(f)"$(< $DIRSTACKFILE)"}(N) )
     # "cd -" won't work after login by just setting $OLDPWD, so
-    [[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD
+    [[ -d $dirstack[1] ]] && cd -q $dirstack[1] && cd -q $OLDPWD
 fi

 if zstyle -T ':grml:chpwd:dirstack' filter-on-load; then

His reply:

> looks better AFAICT! just /home/mika is in the "temporary" dirstack
> (not ~/.zdirs though!) twice, unsure whether that's wanted or not.

So that's a start.

The idea is to use "-q" so the implicit chdirs don't trigger the
chpwd() hook function.

Mika: If you can reproduce the "weird directories in dirstack" issue,
please try the following and paste the result in here (it'll produce
a fair bit of output on the commandline as zsh starts up):

diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc
index 72fde6e..ebc5678 100644
--- a/etc/zsh/zshrc
+++ b/etc/zsh/zshrc
@@ -1588,12 +1588,13 @@ isgrmlcd && HISTSIZE=500  || HISTSIZE=5000
 isgrmlcd && SAVEHIST=1000 || SAVEHIST=10000 # useful for setopt append_history
 
 # dirstack handling
-
+set -x
 DIRSTACKSIZE=${DIRSTACKSIZE:-20}
 DIRSTACKFILE=${DIRSTACKFILE:-${ZDOTDIR:-${HOME}}/.zdirs}
 
 typeset -gaU GRML_PERSISTENT_DIRSTACK
 function grml_dirstack_filter() {
+    setopt local_options xtrace
     local -a exclude
     local filter entry
     if zstyle -s ':grml:chpwd:dirstack' filter filter; then
@@ -1608,6 +1609,7 @@ function grml_dirstack_filter() {
 }
 
 chpwd() {
+    setopt local_options xtrace
     (( $DIRSTACKSIZE <= 0 )) && return
     [[ -z $DIRSTACKFILE ]] && return
     grml_dirstack_filter $PWD && return
@@ -1637,6 +1639,7 @@ if zstyle -T ':grml:chpwd:dirstack' filter-on-load; then
 else
     GRML_PERSISTENT_DIRSTACK=( "${dirstack[@]}" )
 fi
+set +x
 
 # directory based profiles
 

Regards, Frank
History
Date User Action Args
2015-07-20 22:16:09ftsetrecipients: + mika
2015-07-20 22:16:08ftsetmessageid: <1437430568.9.0.488525585631.issue1567@bts.grml.org>
2015-07-20 22:16:08ftlinkissue1567 messages
2015-07-20 22:16:08ftcreate