Skip to content

fix(zsh): detect relative paths through symlinks as directories#1256

Closed
salarkhannn wants to merge 1 commit into
ajeetdsouza:mainfrom
salarkhannn:fix/zsh-symlink-path-detection
Closed

fix(zsh): detect relative paths through symlinks as directories#1256
salarkhannn wants to merge 1 commit into
ajeetdsouza:mainfrom
salarkhannn:fix/zsh-symlink-path-detection

Conversation

@salarkhannn

Copy link
Copy Markdown

When the current directory is a symlink, [[ -d ../foo ]] resolves the symlink before expanding .., so the directory check fails even though cd ../foo would succeed using the shell's logical path tracking.

Fix: also match paths containing .. so they fall through to __zoxide_cd, which relies on the shell's native cd behavior.

Closes #1166

When cwd is a symlink, [[ -d ../foo ]] follows the symlink before
resolving .., so the check fails even though cd ../foo would succeed
via the shell's logical path tracking. Allow paths containing ..
through to __zoxide_cd, which relies on the shell's native cd behavior.

Fixes ajeetdsouza#1166
@ajeetdsouza

Copy link
Copy Markdown
Owner

Thanks for the PR. However, this would break queries that used .. as keywords. I found a fix that should work: 63ef551

@ajeetdsouza ajeetdsouza closed this Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relative paths involving symlinks not detected as directories

2 participants