From d0a6843d2bc4051fe3e46bcaf211814936c68534 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Sat, 4 Jul 2026 15:51:04 +0530 Subject: [PATCH 1/8] Bash/POSIX: check directory existence using cd --- CHANGELOG.md | 4 +++- templates/bash.txt | 2 +- templates/posix.txt | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a33d039..d45d2d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `import` now skips directories matching `$_ZO_EXCLUDE_DIRS`. - POSIX: support for non-Cygwin Windows environments (e.g. Busybox). - Fish: Space-Tab completions now display and run the selected command. +- Bash/POSIX: `z` now honors `$CDPATH`. ### Changed @@ -24,7 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Bash/Fish/POSIX/Zsh: resolve symlinks on Windows. +- Bash/POSIX: `z` now handles relative paths through symlinked directories. +- Bash/Fish/POSIX/Zsh: `_ZO_RESOLVE_SYMLINKS` now works on Windows. - Bash: handle `$PROMPT_COMMAND` values ending in a semicolon. - PowerShell: navigate to home directory with `z` on drives that don't define `HOME`. - PowerShell: use fully qualified names when invoking cmdlets. diff --git a/templates/bash.txt b/templates/bash.txt index e268a9d..2244ed7 100644 --- a/templates/bash.txt +++ b/templates/bash.txt @@ -111,7 +111,7 @@ function __zoxide_z() { __zoxide_cd ~ elif [[ $# -eq 1 && $1 == '-' ]]; then __zoxide_cd "${OLDPWD}" - elif [[ $# -eq 1 && -d $1 ]]; then + elif [[ $# -eq 1 ]] && (\builtin cd -- "$1") &>/dev/null; then __zoxide_cd "$1" elif [[ $# -eq 2 && $1 == '--' ]]; then __zoxide_cd "$2" diff --git a/templates/posix.txt b/templates/posix.txt index 7a1b888..7c48f27 100644 --- a/templates/posix.txt +++ b/templates/posix.txt @@ -105,7 +105,7 @@ __zoxide_z() { \command printf 'zoxide: $OLDPWD is not set' return 1 fi - elif [ "$#" -eq 1 ] && [ -d "$1" ]; then + elif [ "$#" -eq 1 ] && (\command cd -- "$1") >/dev/null 2>&1; then __zoxide_cd "$1" else __zoxide_result="$(\command zoxide query --exclude "$(__zoxide_pwd || \command true)" -- "$@")" && From 63ef5518e2c9805e3434cc5bb607ae0cc9631e21 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Sat, 4 Jul 2026 16:52:41 +0530 Subject: [PATCH 2/8] Zsh: check directory existence using cd --- CHANGELOG.md | 5 +++-- templates/zsh.txt | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d45d2d4..253bc45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,16 +16,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `import` now skips directories matching `$_ZO_EXCLUDE_DIRS`. - POSIX: support for non-Cygwin Windows environments (e.g. Busybox). - Fish: Space-Tab completions now display and run the selected command. -- Bash/POSIX: `z` now honors `$CDPATH`. +- Bash/POSIX/Zsh: `z` now honors `$CDPATH`. ### Changed +- `import` now takes a subcommand instead of the `--from` flag. - `import` now auto-detects database files. - Nushell: export commands so the init script can be imported with `use`. ### Fixed -- Bash/POSIX: `z` now handles relative paths through symlinked directories. +- Bash/POSIX/Zsh: `z` now handles relative paths through symlinked directories. - Bash/Fish/POSIX/Zsh: `_ZO_RESOLVE_SYMLINKS` now works on Windows. - Bash: handle `$PROMPT_COMMAND` values ending in a semicolon. - PowerShell: navigate to home directory with `z` on drives that don't define `HOME`. diff --git a/templates/zsh.txt b/templates/zsh.txt index 9cdbcc2..c72178f 100644 --- a/templates/zsh.txt +++ b/templates/zsh.txt @@ -89,7 +89,9 @@ function __zoxide_z() { __zoxide_doctor if [[ "$#" -eq 0 ]]; then __zoxide_cd ~ - elif [[ "$#" -eq 1 ]] && { [[ -d "$1" ]] || [[ "$1" = '-' ]] || [[ "$1" =~ ^[-+][0-9]+$ ]]; }; then + elif [[ "$#" -eq 1 ]] && [[ "$1" = '-' ]]; then + __zoxide_cd "${OLDPWD}" + elif [[ "$#" -eq 1 ]] && { [[ "$1" =~ ^[-+][0-9]+$ ]] || (\builtin cd -q -- "$1") &>/dev/null; }; then __zoxide_cd "$1" elif [[ "$#" -eq 2 ]] && [[ "$1" = "--" ]]; then __zoxide_cd "$2" From 7c1395a11684aed80d5b1a83952139ce4dbea011 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Sat, 4 Jul 2026 17:17:02 +0530 Subject: [PATCH 3/8] Remove .deepsource.toml --- .deepsource.toml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .deepsource.toml diff --git a/.deepsource.toml b/.deepsource.toml deleted file mode 100644 index 2895393..0000000 --- a/.deepsource.toml +++ /dev/null @@ -1,10 +0,0 @@ -version = 1 - -[[analyzers]] -name = "rust" - - [analyzers.meta] - msrv = "stable" - -[[analyzers]] -name = "shell" \ No newline at end of file From cb991a72f910d35162b98170daf23eec77400922 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Sat, 4 Jul 2026 17:36:07 +0530 Subject: [PATCH 4/8] Bash: don't add to the database when history is disabled --- CHANGELOG.md | 7 ++++--- templates/bash.txt | 10 +++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 253bc45..9958fe4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,18 +11,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Support for RISC-V (riscv64) Linux. - `import` now supports fetching entries from `atuin`. +- `import` now auto-detects database files. - `import` now skips directories matching `$_ZO_EXCLUDE_DIRS`. - POSIX: support for non-Cygwin Windows environments (e.g. Busybox). - Fish: Space-Tab completions now display and run the selected command. - Bash/POSIX/Zsh: `z` now honors `$CDPATH`. +- Bash: don't add to the database when history is disabled (`set +o history`). +- Nushell: export commands so the init script can be imported with `use`. +- Support for RISC-V (riscv64) Linux. ### Changed - `import` now takes a subcommand instead of the `--from` flag. -- `import` now auto-detects database files. -- Nushell: export commands so the init script can be imported with `use`. ### Fixed diff --git a/templates/bash.txt b/templates/bash.txt index 2244ed7..e5df5c7 100644 --- a/templates/bash.txt +++ b/templates/bash.txt @@ -37,8 +37,10 @@ function __zoxide_cd() { {%- if hook == InitHook::Prompt %} function __zoxide_hook() { \builtin local -r retval="$?" - # shellcheck disable=SC2312 - \command zoxide add -- "$(__zoxide_pwd)" + if [[ -o history ]]; then + # shellcheck disable=SC2312 + \command zoxide add -- "$(__zoxide_pwd)" + fi return "${retval}" } @@ -51,7 +53,9 @@ function __zoxide_hook() { pwd_tmp="$(__zoxide_pwd)" if [[ ${__zoxide_oldpwd} != "${pwd_tmp}" ]]; then __zoxide_oldpwd="${pwd_tmp}" - \command zoxide add -- "${__zoxide_oldpwd}" + if [[ -o history ]]; then + \command zoxide add -- "${__zoxide_oldpwd}" + fi fi return "${retval}" } From a603fc5d9c6d09a3028b9568039334682908dff8 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Sat, 4 Jul 2026 18:03:56 +0530 Subject: [PATCH 5/8] chore(release): v0.10.0 --- CHANGELOG.md | 2 +- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9958fe4..a6c65df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## [0.10.0] - 2026-07-04 ### Added diff --git a/Cargo.lock b/Cargo.lock index b993b19..16edf6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1152,7 +1152,7 @@ checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" [[package]] name = "zoxide" -version = "0.9.9" +version = "0.10.0" dependencies = [ "anyhow", "askama", diff --git a/Cargo.toml b/Cargo.toml index 74be3ef..bfcf408 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ name = "zoxide" readme = "README.md" repository = "https://github.com/ajeetdsouza/zoxide" rust-version = "1.88.0" -version = "0.9.9" +version = "0.10.0" [badges] maintenance = { status = "actively-developed" } From f84f9a3e1d16fabf3e34b199ec7d552993b41f29 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Sat, 4 Jul 2026 18:09:56 +0530 Subject: [PATCH 6/8] Fix link in CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6c65df..8c803fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -584,6 +584,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - GitHub Actions pipeline to build and upload releases. - Add support for Zsh. +[0.10.0]: https://github.com/ajeetdsouza/zoxide/compare/v0.9.9...v0.10.0 [0.9.9]: https://github.com/ajeetdsouza/zoxide/compare/v0.9.8...v0.9.9 [0.9.8]: https://github.com/ajeetdsouza/zoxide/compare/v0.9.7...v0.9.8 [0.9.7]: https://github.com/ajeetdsouza/zoxide/compare/v0.9.6...v0.9.7 From 1f484a4e344e819ce3b537fc6f80ada8a78c687a Mon Sep 17 00:00:00 2001 From: Rayan Salhab Date: Tue, 7 Jul 2026 02:09:13 +0300 Subject: [PATCH 7/8] Fix MSYS2 cygpath pwd substitution (#1260) --------- Co-authored-by: cyphercodes Co-authored-by: Ajeet D'Souza <98ajeet@gmail.com> --- CHANGELOG.md | 6 ++++++ templates/bash.txt | 2 +- templates/zsh.txt | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c803fd..d57588e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- Bash/Zsh: fix `z` failing on Cygwin/MSYS2 due to `cygpath` being passed a bad string. + ## [0.10.0] - 2026-07-04 ### Added diff --git a/templates/bash.txt b/templates/bash.txt index e5df5c7..d3be26c 100644 --- a/templates/bash.txt +++ b/templates/bash.txt @@ -16,7 +16,7 @@ function __zoxide_pwd() { {%- let pwd = "\\builtin pwd -L" -%} {%- endif -%} {%- if cfg!(windows) %} - \command cygpath -w "{{ pwd }}" + \command cygpath -w "$({{ pwd }})" {%- else %} {{ pwd }} {%- endif %} diff --git a/templates/zsh.txt b/templates/zsh.txt index c72178f..fe67c1f 100644 --- a/templates/zsh.txt +++ b/templates/zsh.txt @@ -16,7 +16,7 @@ function __zoxide_pwd() { {%- let pwd = "\\builtin pwd -L" -%} {%- endif -%} {%- if cfg!(windows) %} - \command cygpath -w "{{ pwd }}" + \command cygpath -w "$({{ pwd }})" {%- else %} {{ pwd }} {%- endif %} From 670bdf21b98fea0d82c5bb609665f2edf561d6d7 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Mon, 13 Jul 2026 15:36:47 +0530 Subject: [PATCH 8/8] Nushell: handle symlinked directories --- .github/workflows/cd.yml | 2 +- CHANGELOG.md | 1 + templates/nushell.txt | 11 +++++------ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 9e3ff41..d56205b 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,4 +1,4 @@ -name: Continuous Deployment +name: cd on: push: tags: diff --git a/CHANGELOG.md b/CHANGELOG.md index d57588e..a952e0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Bash/Zsh: fix `z` failing on Cygwin/MSYS2 due to `cygpath` being passed a bad string. +- Nushell: `z` now handles relative paths through symlinked directories. ## [0.10.0] - 2026-07-04 diff --git a/templates/nushell.txt b/templates/nushell.txt index 2cf358a..e2aa661 100644 --- a/templates/nushell.txt +++ b/templates/nushell.txt @@ -57,15 +57,14 @@ export-env { # Jump to a directory using only keywords. export def --env --wrapped __zoxide_z [...rest: directory] { - let path = match $rest { - [] => {'~'}, - [ '-' ] => {'-'}, - [ $arg ] if ($arg | path expand | path type) == 'dir' => {$arg} + match $rest { + [] => { cd ~ }, + [ '-' ] => { cd - }, + [ $arg ] if (try { cd $arg; true } catch { false }) => {}, _ => { - ^zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n" + cd (^zoxide query --exclude $env.PWD -- ...$rest | str trim -r -c "\n") } } - cd $path {%- if echo %} echo $env.PWD {%- endif %}