zsh-workers
 help / color / mirror / code / Atom feed
From: Han Boetes <hboetes@gmail.com>
To: zsh-workers@zsh.org
Subject: cd does not update $PWD in a timely fashion.
Date: Fri, 26 Jun 2020 19:24:21 +0200	[thread overview]
Message-ID: <CAOzo9e6MHyWNbpeD=804ZyBAAQJVEQHTHZXYcmKGm9G2WNZHYg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 823 bytes --]

I had this program changing the name of the current working directory and
noticed cd .; echo $PWD didn't pick up the changes.

The following code replicates the problem.

% set -x;mkdir foo; cd foo; mv ~/foo ~/bar; echo $PWD;pwd; readlink -f .;
cd .; echo $PWD ;pwd; readlink -f .; cd .; echo $PWD ;pwd; readlink -f .
+/bin/zsh:8> mkdir foo
+/bin/zsh:8> cd foo
+/bin/zsh:8> mv -i /home/han/foo /home/han/bar
+/bin/zsh:8> echo /home/han/foo
/home/han/foo
+/bin/zsh:8> pwd
/home/han/foo
+/bin/zsh:8> readlink -f .
/home/han/bar
+/bin/zsh:8> cd .
+/bin/zsh:8> echo /home/han/foo
/home/han/foo
+/bin/zsh:8> pwd
/home/han/bar
+/bin/zsh:8> readlink -f .
/home/han/bar
+/bin/zsh:8> cd .
+/bin/zsh:8> echo /home/han/bar
/home/han/bar
+/bin/zsh:8> pwd
/home/han/bar
+/bin/zsh:8> readlink -f .
/home/han/bar


With kind regards,
Han

             reply	other threads:[~2020-06-26 17:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26 17:24 Han Boetes [this message]
2020-06-26 17:32 ` Matthew Martin
2020-06-27  7:25   ` Matthew Martin
2020-06-27 20:42     ` Daniel Shahaf
2020-07-01  4:41       ` Matthew Martin

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='CAOzo9e6MHyWNbpeD=804ZyBAAQJVEQHTHZXYcmKGm9G2WNZHYg@mail.gmail.com' \
    --to=hboetes@gmail.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).