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 Apr 1, 2024
1 parent 9f67fb5 commit bc45490
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- fish: detect infinite loop when using `alias cd=z`.
- fish / Nushell / PowerShell: handle queries that look like args (e.g. `z -x`).
- zsh: resolve symlinks also applies on `__zoxide_cd`

## [0.9.4] - 2024-02-21

Expand Down
10 changes: 7 additions & 3 deletions templates/zsh.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ function __zoxide_pwd() {
{%- endif %}
}

# cd + custom logic based on the value of _ZO_ECHO.
# cd + custom logic based on the value of _ZO_ECHO and _ZO_RESOLVE_SYMLINKS
function __zoxide_cd() {
# shellcheck disable=SC2164
\builtin cd -- "$@" {%- if echo %} && __zoxide_pwd {%- endif %}
{%- if resolve_symlinks && cfg!(not(windows)) %}
\builtin cd -P -- "$@"
{%- else %}
\builtin cd -- "$@"
{%- endif %}
{%- if echo %} && __zoxide_pwd {% endif %}
}

{{ section }}
Expand Down

0 comments on commit bc45490

Please sign in to comment.