fix resolves symlink on `cd` at zsh

This commit is contained in:
dalton-oliveira 2024-04-01 10:00:58 -03:00
parent ede1224259
commit 52175d8678
1 changed files with 8 additions and 3 deletions

View File

@ -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 }}