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

Re: inherit OLDPWD from environment variable



> On 17/07/2024 08:59 BST Franklin Yu <franklinyu@xxxxxxxxxxx> wrote:
> Hi folks, this could be either a bug report or feature request.
> 
> When I start Zsh with $OLDPWD set to a path different from $PWD, Zsh overwrites
> $OLDPWD with $PWD. Is this expected, or is it a side effect of making sure
> $OLDPWD is non-empty?

I think it's just making sure OLDPWD is set to something on
initialisation.  The only comment says "initialize `OLDPWD' = `PWD'".

I can't think of any obvious objection to importing a value from the
environment and only setting the variable to $PWD if that was empty.
Until the directory within the shell changes its value is pretty
arbitrary.

pws




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