Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] make OLDPWD influence 'cd -'



On Jun 3, 11:52am, hanpingtian wrote:
} Subject: [PATCH] make OLDPWD influence 'cd -'
} 
} This patch will let zsh check OLDPWD before run 'cd -', so let OLDPWD
} influence it:
} [hpt@hpt]~% echo $OLDPWD
} /home/hpt
} [hpt@hpt]~% vared OLDPWD
} /tmp
} [hpt@hpt]~% cd -
} /tmp
} [hpt@hpt]/tmp% pwd
} /tmp

Hmm.  Aside from the fact that this makes OLDPWD sort of half a special
variable -- it at least moves it from the "set by the shell" category
into "used by the shell" -- I think putting this behavior into the "cd"
command may not be the best place for it.

In particular, it means that "cd -" and "cd ~-" become different things,
where currently they're all equivalent.  Further, it affects "pushd -"
so that it no longer refers to the top of the directory stack.

-- 



Messages sorted by: Reverse Date, Date, Thread, Author