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 Jun 3, 2024
1 parent dbe6f18 commit 96a54c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- zsh: better cd completions.
- elvish: `z -` now work as expected.
- Lazily delete excluded directories from the database.
- zsh: resolve symlinks also applies on `__zoxide_cd`

## [0.9.4] - 2024-02-21

Expand Down
11 changes: 8 additions & 3 deletions templates/zsh.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,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 96a54c8

Please sign in to comment.