From: "Ajeet D'Souza" <98ajeet@gmail.com>
To: zsh-workers@zsh.org
Subject: Bug: pwd reports wrong path inside chpwd_functions
Date: Sat, 12 Dec 2020 01:11:45 +0530 [thread overview]
Message-ID: <CAF6KdoXYobqs0NE5F+BYtxmEuGnFuP47AX4xmicGx3mHCB6=FA@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 752 bytes --]
Using pwd -L inside the chpwd_functions hook inside zsh returns an invalid
path. Here are some steps to reproduce this:
function print_dir() { pwd -L } ;
chpwd_functions=(print_dir) ;
mkdir -p /tmp/chdir-test/symbolic-links/ ;
mkdir -p /tmp/chdir-test/actual-directories/folder1 ;
mkdir -p /tmp/chdir-test/actual-directories/folder2 ;
ln -s /tmp/chdir-test/actual-directories/folder1
/tmp/chdir-test/symbolic-links ;
# This works fine:
cd /tmp/chdir-test/symbolic-links/folder1 ;
# >> /tmp/chdir-test/symbolic-links/folder1
# This prints a path that does not exist (try it with cd!)
cd ../folder2 ;
# >> /tmp/chdir-test/*symbolic-links*/folder2
# This works fine
pwd -L ;
# >> /tmp/chdir-test/*actual-directories*/folder2
Thanks,
Ajeet D'Souza
[-- Attachment #2: Type: text/html, Size: 1897 bytes --]
next reply other threads:[~2020-12-11 19:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-11 19:41 Ajeet D'Souza [this message]
2020-12-11 22:02 ` Bart Schaefer
2020-12-12 21:33 ` Ajeet D'Souza
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='CAF6KdoXYobqs0NE5F+BYtxmEuGnFuP47AX4xmicGx3mHCB6=FA@mail.gmail.com' \
--to=98ajeet@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).