From 52175d8678802aaa0bfc284ada80ca56264bfde3 Mon Sep 17 00:00:00 2001 From: dalton-oliveira Date: Mon, 1 Apr 2024 10:00:58 -0300 Subject: [PATCH] fix resolves symlink on `cd` at zsh --- templates/zsh.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/templates/zsh.txt b/templates/zsh.txt index 82a6b8a..40949dd 100644 --- a/templates/zsh.txt +++ b/templates/zsh.txt @@ -18,10 +18,15 @@ function __zoxide_pwd() { {%- endif %} } -# cd + custom logic based on the value of _ZO_ECHO. +# cd + custom logic based on the values of _ZO_ECHO and _ZO_RESOLVE_SYMLINKS. function __zoxide_cd() { - # shellcheck disable=SC2164 - \builtin cd -- "$@" {%- if echo %} && __zoxide_pwd {%- endif %} +# shellcheck disable=SC2164 +{%- if resolve_symlinks %} + \builtin cd -P -- "$@" +{%- else %} + \builtin cd -- "$@" +{%- endif %} +{%- if echo %} && __zoxide_pwd {% endif %} } {{ section }}