zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Franklin Yu <franklinyu@hotmail.com>,
	"zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: inherit OLDPWD from environment variable
Date: Wed, 17 Jul 2024 10:02:34 +0100 (BST)	[thread overview]
Message-ID: <1965706625.4711169.1721206954792@mail.virginmedia.com> (raw)
In-Reply-To: <BL1PR14MB5121A4AAF920CD40EFACFC3CD8A32@BL1PR14MB5121.namprd14.prod.outlook.com>

> On 17/07/2024 08:59 BST Franklin Yu <franklinyu@hotmail.com> 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


  reply	other threads:[~2024-07-17  9:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-17  7:59 Franklin Yu
2024-07-17  9:02 ` Peter Stephenson [this message]
2024-07-20  1:55 Franklin Yu
2024-07-20  2:46 ` Lawrence Velázquez
2024-07-20  7:56   ` Franklin Yu
2024-07-21 19:30     ` Peter Stephenson
2024-07-21 20:48       ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1965706625.4711169.1721206954792@mail.virginmedia.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=franklinyu@hotmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).