Skip to content

Commit

Permalink
fix resolves symlink on cd at zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
dalton-oliveira committed Oct 26, 2024
1 parent ede1224 commit 52175d8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions templates/zsh.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 52175d8

Please sign in to comment.