zsh-workers
 help / color / mirror / code / Atom feed
* Bug: pwd reports wrong path inside chpwd_functions
@ 2020-12-11 19:41 Ajeet D'Souza
  2020-12-11 22:02 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Ajeet D'Souza @ 2020-12-11 19:41 UTC (permalink / raw)
  To: zsh-workers

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-12 21:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11 19:41 Bug: pwd reports wrong path inside chpwd_functions Ajeet D'Souza
2020-12-11 22:02 ` Bart Schaefer
2020-12-12 21:33   ` Ajeet D'Souza

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).