fix(zsh): detect relative paths through symlinks as directories
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 #1166
This commit is contained in:
parent
84bd26ebe3
commit
daa5f384b2
|
|
@ -89,7 +89,7 @@ function __zoxide_z() {
|
|||
__zoxide_doctor
|
||||
if [[ "$#" -eq 0 ]]; then
|
||||
__zoxide_cd ~
|
||||
elif [[ "$#" -eq 1 ]] && { [[ -d "$1" ]] || [[ "$1" = '-' ]] || [[ "$1" =~ ^[-+][0-9]+$ ]]; }; then
|
||||
elif [[ "$#" -eq 1 ]] && { [[ -d "$1" ]] || [[ "$1" = *..* ]] || [[ "$1" = '-' ]] || [[ "$1" =~ ^[-+][0-9]+$ ]]; }; then
|
||||
__zoxide_cd "$1"
|
||||
elif [[ "$#" -eq 2 ]] && [[ "$1" = "--" ]]; then
|
||||
__zoxide_cd "$2"
|
||||
|
|
|
|||
Loading…
Reference in New Issue