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 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
zsh-workers This inbox may be cloned and mirrored by anyone: git clone --mirror http://inbox.vuxu.org/zsh-workers # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V1 zsh-workers zsh-workers/ http://inbox.vuxu.org/zsh-workers \ zsh-workers@zsh.org public-inbox-index zsh-workers Example config snippet for mirrors. Newsgroup available over NNTP: nntp://inbox.vuxu.org/vuxu.archive.zsh.workers code repositories for the project(s) associated with this inbox: https://git.vuxu.org/mirror/zsh/ AGPL code for this site: git clone https://public-inbox.org/public-inbox.git