diff --git a/templates/zsh.txt b/templates/zsh.txt index 82a6b8a9..40949dd3 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 }}