From 0c55cb9621dd6c8e9344b9aa846296f4513b8cc6 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Tue, 18 Nov 2025 06:32:03 +0530 Subject: [PATCH 01/20] Avoid wrecking pipestatus in Bash (#1141) --- templates/bash.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/bash.txt b/templates/bash.txt index 8c96deb..f96edb0 100644 --- a/templates/bash.txt +++ b/templates/bash.txt @@ -56,10 +56,12 @@ function __zoxide_hook() { # Initialize hook. if [[ ${PROMPT_COMMAND:=} != *'__zoxide_hook'* ]]; then if [[ "$(declare -p PROMPT_COMMAND 2>&1)" == "declare -a"* ]]; then - PROMPT_COMMAND=(__zoxide_hook "${PROMPT_COMMAND[@]}") + PROMPT_COMMAND=("${PROMPT_COMMAND[@]}" __zoxide_hook) else - # shellcheck disable=SC2178 - PROMPT_COMMAND="__zoxide_hook;${PROMPT_COMMAND#;}" + # shellcheck disable=SC2128,SC2178 + PROMPT_COMMAND="${PROMPT_COMMAND%"${PROMPT_COMMAND##*[![:space:]]}"}" + # shellcheck disable=SC2128,SC2178 + PROMPT_COMMAND="${PROMPT_COMMAND:+${PROMPT_COMMAND};}__zoxide_hook" fi fi From e3212cdc0883c8402b429d775d4883847752e0e2 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Tue, 18 Nov 2025 13:54:46 +0530 Subject: [PATCH 02/20] Use template for mktemp (#1140) --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 1e44feb..3108dd4 100755 --- a/install.sh +++ b/install.sh @@ -31,7 +31,7 @@ main() { # Create and enter a temporary directory. local _tmp_dir - _tmp_dir="$(mktemp -d)" || err "mktemp: could not create temporary directory" + _tmp_dir="$(mktemp -d /tmp/zoxide_XXXXXX)" || err "mktemp: could not create temporary directory" cd "${_tmp_dir}" || err "cd: failed to enter directory: ${_tmp_dir}" # Download and extract zoxide. From 9e82a6d12779bb1a25a23903ebcee83322f12639 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Tue, 18 Nov 2025 14:05:45 +0530 Subject: [PATCH 03/20] Add ARMv7 target for Android in release workflow (#1144) --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7398a6a..099d950 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,8 @@ jobs: deb: true - os: ubuntu-latest target: aarch64-linux-android + - os: ubuntu-latest + target: armv7-linux-androideabi - os: macos-latest target: x86_64-apple-darwin - os: macos-latest From ecf72c9cfdc0c8f04ac1e2953bb3703ea6805e05 Mon Sep 17 00:00:00 2001 From: Mark Derricutt Date: Tue, 18 Nov 2025 22:19:41 +1300 Subject: [PATCH 04/20] Update zoxide to support Fish 4.1.x (#1046) --- templates/fish.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/fish.txt b/templates/fish.txt index f6ade18..038e08e 100644 --- a/templates/fish.txt +++ b/templates/fish.txt @@ -19,7 +19,11 @@ end # A copy of fish's internal cd function. This makes it possible to use # `alias cd=z` without causing an infinite loop. if ! builtin functions --query __zoxide_cd_internal - string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' <$__fish_data_dir/functions/cd.fish | source + if status list-files functions/cd.fish &>/dev/null + status get-file functions/cd.fish | string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' | source + else + string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' <$__fish_data_dir/functions/cd.fish | source + end end # cd + custom logic based on the value of _ZO_ECHO. From d304543d2ef90eff3f27e7c6029dfdde789598cf Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Tue, 18 Nov 2025 20:14:28 +0530 Subject: [PATCH 05/20] Remove uses of builtin from POSIX (#1146) --- templates/posix.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/posix.txt b/templates/posix.txt index b7ba9b3..6219b58 100644 --- a/templates/posix.txt +++ b/templates/posix.txt @@ -10,7 +10,7 @@ # pwd based on the value of _ZO_RESOLVE_SYMLINKS. __zoxide_pwd() { {%- if cfg!(windows) %} - \command cygpath -w "$(\builtin pwd -P)" + \command cygpath -w "$(\command pwd -P)" {%- else if resolve_symlinks %} \command pwd -P {%- else %} @@ -35,7 +35,7 @@ __zoxide_cd() { {%- when InitHook::Prompt -%} # Hook to add new entries to the database. __zoxide_hook() { - \command zoxide add -- "$(__zoxide_pwd || \builtin true)" + \command zoxide add -- "$(__zoxide_pwd || \command true)" } # Initialize hook. @@ -95,7 +95,7 @@ __zoxide_z() { elif [ "$#" -eq 1 ] && [ -d "$1" ]; then __zoxide_cd "$1" else - __zoxide_result="$(\command zoxide query --exclude "$(__zoxide_pwd || \builtin true)" -- "$@")" && + __zoxide_result="$(\command zoxide query --exclude "$(__zoxide_pwd || \command true)" -- "$@")" && __zoxide_cd "${__zoxide_result}" fi } From da3905ba848ba63b4789f62663a59e7abb9b8053 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 03:14:24 +0530 Subject: [PATCH 06/20] Bump Swatinem/rust-cache from 2.8.1 to 2.8.2 (#1154) Bumps [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) from 2.8.1 to 2.8.2. - [Release notes](https://github.com/swatinem/rust-cache/releases) - [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md) - [Commits](https://github.com/swatinem/rust-cache/compare/v2.8.1...v2.8.2) --- updated-dependencies: - dependency-name: Swatinem/rust-cache dependency-version: 2.8.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87368c6..9ccdb38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: authToken: ${{ env.CACHIX_AUTH_TOKEN }} name: zoxide - name: Setup cache - uses: Swatinem/rust-cache@v2.8.1 + uses: Swatinem/rust-cache@v2.8.2 with: key: ${{ matrix.os }} - name: Install just diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 099d950..7a0c50a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,7 +61,7 @@ jobs: override: true target: ${{ matrix.target }} - name: Setup cache - uses: Swatinem/rust-cache@v2.8.1 + uses: Swatinem/rust-cache@v2.8.2 with: key: ${{ matrix.target }} - name: Install cross From 20dd3e1ec6d6e559ad64e7e7b6c797965ad5309a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 03:14:34 +0530 Subject: [PATCH 07/20] Bump actions/checkout from 5 to 6 (#1152) Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ccdb38..3f35ac3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: matrix: os: [ubuntu-latest] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a0c50a..4ba6c83 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,7 @@ jobs: target: aarch64-pc-windows-msvc steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Get version From f00fe0f0aeaeaf8fda48ca467c706a5174830b77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 00:19:31 +0530 Subject: [PATCH 08/20] Bump actions/upload-artifact from 5 to 6 (#1157) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ba6c83..27a5166 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -102,7 +102,7 @@ jobs: CHANGELOG.md LICENSE README.md ./man/ ./contrib/completions/ ` ./target/${{ matrix.target }}/release/zoxide.exe - name: Upload artifact - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: ${{ matrix.target }} path: | From 324b0d35e72efd52259b77c800487de373cb66df Mon Sep 17 00:00:00 2001 From: Simon Olofsson Date: Fri, 30 Jan 2026 12:24:27 +0100 Subject: [PATCH 09/20] fish: clear existing completions before defining aliases (#1165) Fish ships with built-in completions for common commands like `j` (share/completions/j.fish for autojump). These override zoxide's completions when using `--cmd j`. Clear them before defining aliases. --- templates/fish.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/fish.txt b/templates/fish.txt index 038e08e..36ca833 100644 --- a/templates/fish.txt +++ b/templates/fish.txt @@ -117,9 +117,11 @@ end {%- when Some with (cmd) %} abbr --erase {{cmd}} &>/dev/null +complete --erase --command {{cmd}} alias {{cmd}}=__zoxide_z abbr --erase {{cmd}}i &>/dev/null +complete --erase --command {{cmd}}i alias {{cmd}}i=__zoxide_zi {%- when None %} From 52a716fed6be54665cb4085b1b1aab259062c131 Mon Sep 17 00:00:00 2001 From: stringscut Date: Fri, 30 Jan 2026 19:25:23 +0800 Subject: [PATCH 10/20] chore: improve code comments clarity (#1158) Signed-off-by: stringscut --- src/cmd/import.rs | 2 +- src/db/mod.rs | 2 +- src/db/stream.rs | 2 +- src/shell.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cmd/import.rs b/src/cmd/import.rs index f13381c..ac0777a 100644 --- a/src/cmd/import.rs +++ b/src/cmd/import.rs @@ -37,7 +37,7 @@ fn import_autojump(db: &mut Database, buffer: &str) -> Result<()> { let mut rank = rank.parse::().with_context(|| format!("invalid rank: {rank}"))?; // Normalize the rank using a sigmoid function. Don't import actual ranks from // autojump, since its scoring algorithm is very different and might - // take a while to get normalized. + // take a while to normalize. rank = sigmoid(rank); db.add_unchecked(path, rank, 0); diff --git a/src/db/mod.rs b/src/db/mod.rs index d459f39..86808f2 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -76,7 +76,7 @@ impl Database { } /// Creates a new directory. This will create a duplicate entry if this - /// directory is always in the database, it is expected that the user either + /// directory is already in the database, it is expected that the user either /// does a check before calling this, or calls `dedup()` afterward. pub fn add_unchecked(&mut self, path: impl AsRef + Into, rank: Rank, now: Epoch) { self.with_dirs_mut(|dirs| { diff --git a/src/db/stream.rs b/src/db/stream.rs index 4b06193..24c84e0 100644 --- a/src/db/stream.rs +++ b/src/db/stream.rs @@ -70,7 +70,7 @@ impl<'a> Stream<'a> { } // The logic here is reversed - if we resolve symlinks when adding entries to - // the database, we should not return symlinks when querying back from + // the database, we should not return symlinks when querying from // the database. let resolver = if self.options.resolve_symlinks { fs::symlink_metadata } else { fs::metadata }; diff --git a/src/shell.rs b/src/shell.rs index 37fe1a2..8812b1c 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -100,7 +100,7 @@ mod tests { let mut source = String::new(); // Filter out lines using edit:*, since those functions are only available in - // the interactive editor. + // interactive editor mode. for line in Elvish(&opts).render().unwrap().lines().filter(|line| !line.contains("edit:")) { source.push_str(line); source.push('\n'); From 9cdc6aa3740b4d8a9d62406c99e84c5de49645e9 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Sat, 31 Jan 2026 13:12:16 +0530 Subject: [PATCH 11/20] chore(release): v0.9.9 --- CHANGELOG.md | 23 ++++++++++++++++++++--- Cargo.lock | 2 +- Cargo.toml | 2 +- src/db/mod.rs | 5 +++-- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 071a7c6..ffcaafd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,22 @@ 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). +## [0.9.9] - 2026-01-31 + +### Added + +- Support for Android ARMv7. +- Fish: support for v4.1.0+. + +### Fixed + +- Nushell: use sigil operator when calling external commands. +- Zsh: support multiple digits in `z +N` and `z -N` dirstack commands. +- Bash: avoid downcasting `$PROMPT_COMMAND` array into a string. +- Bash: avoid overwriting `$PIPESTATUS`. +- POSIX: remove non-POSIX compliant calls to `builtin`. +- Fish: clear existing completions when defining `z` command. + ## [0.9.8] - 2025-05-27 ### Added @@ -22,7 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Bash: doctor now handles `PROMPT_COMMAND` being an array. +- Bash: doctor now handles `$PROMPT_COMMAND` being an array. - Bash: doctor now handles Visual Studio Code's shell integration. - Bash: completions now work with `ble.sh`. - Nushell: stop ignoring symlinks when `cd`-ing into a directory. @@ -35,7 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Nushell: support for 0.102.0. +- Nushell: support for v0.102.0. - Bash / Zsh: add doctor to diagnose common issues. ### Fixed @@ -302,7 +318,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `zoxide query --all` for listing deleted directories. - Lazy deletion for removed directories that have not been accessed in > 90 days. -- Nushell: support for 0.32.0+. +- Nushell: support for v0.32.0+. ### Fixed @@ -536,6 +552,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.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 [0.9.6]: https://github.com/ajeetdsouza/zoxide/compare/v0.9.5...v0.9.6 diff --git a/Cargo.lock b/Cargo.lock index 732e696..27da609 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -983,7 +983,7 @@ dependencies = [ [[package]] name = "zoxide" -version = "0.9.8" +version = "0.9.9" dependencies = [ "anyhow", "askama", diff --git a/Cargo.toml b/Cargo.toml index 58b0d57..d137115 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.85.0" -version = "0.9.8" +version = "0.9.9" [badges] maintenance = { status = "actively-developed" } diff --git a/src/db/mod.rs b/src/db/mod.rs index 86808f2..1856fda 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -76,8 +76,9 @@ impl Database { } /// Creates a new directory. This will create a duplicate entry if this - /// directory is already in the database, it is expected that the user either - /// does a check before calling this, or calls `dedup()` afterward. + /// directory is already in the database, it is expected that the user + /// either does a check before calling this, or calls `dedup()` + /// afterward. pub fn add_unchecked(&mut self, path: impl AsRef + Into, rank: Rank, now: Epoch) { self.with_dirs_mut(|dirs| { dirs.push(Dir { path: path.into().into(), rank, last_accessed: now }) From d7458b756ee218e6f597218a8d9065b2032601f1 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Mon, 2 Feb 2026 00:37:36 -0500 Subject: [PATCH 12/20] Support symlinks on Windows (#1149) --- CHANGELOG.md | 10 ++++++++++ templates/bash.txt | 12 ++++++++---- templates/fish.txt | 12 ++++++++---- templates/posix.txt | 25 +++++++++++++++++++------ templates/zsh.txt | 12 ++++++++---- 5 files changed, 53 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffcaafd..6b38fe2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ 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 + +### Added + +- POSIX: support for non-Cygwin Windows environments (e.g. Busybox). + +### Fixed + +- Bash/Fish/POSIX/Zsh: resolve symlinks on Windows. + ## [0.9.9] - 2026-01-31 ### Added diff --git a/templates/bash.txt b/templates/bash.txt index f96edb0..86a2884 100644 --- a/templates/bash.txt +++ b/templates/bash.txt @@ -9,12 +9,16 @@ # pwd based on the value of _ZO_RESOLVE_SYMLINKS. function __zoxide_pwd() { +{%- let pwd -%} +{%- if resolve_symlinks -%} +{%- let pwd = "\\builtin pwd -P" -%} +{%- else -%} +{%- let pwd = "\\builtin pwd -L" -%} +{%- endif -%} {%- if cfg!(windows) %} - \command cygpath -w "$(\builtin pwd -P)" -{%- else if resolve_symlinks %} - \builtin pwd -P + \command cygpath -w "{{ pwd }}" {%- else %} - \builtin pwd -L + {{ pwd }} {%- endif %} } diff --git a/templates/fish.txt b/templates/fish.txt index 36ca833..a13edc7 100644 --- a/templates/fish.txt +++ b/templates/fish.txt @@ -7,12 +7,16 @@ # pwd based on the value of _ZO_RESOLVE_SYMLINKS. function __zoxide_pwd +{%- let pwd -%} +{%- if resolve_symlinks -%} +{%- let pwd = "builtin pwd -P" -%} +{%- else -%} +{%- let pwd = "builtin pwd -L" -%} +{%- endif -%} {%- if cfg!(windows) %} - command cygpath -w (builtin pwd -P) -{%- else if resolve_symlinks %} - builtin pwd -P + command cygpath -w ({{ pwd }}) {%- else %} - builtin pwd -L + {{ pwd }} {%- endif %} end diff --git a/templates/posix.txt b/templates/posix.txt index 6219b58..b3f660c 100644 --- a/templates/posix.txt +++ b/templates/posix.txt @@ -8,15 +8,28 @@ # # pwd based on the value of _ZO_RESOLVE_SYMLINKS. -__zoxide_pwd() { +{%- let pwd -%} +{%- if resolve_symlinks -%} +{%- let pwd = "\\command pwd -P" -%} +{%- else -%} +{%- let pwd = "\\command pwd -L" -%} +{%- endif -%} {%- if cfg!(windows) %} - \command cygpath -w "$(\command pwd -P)" -{%- else if resolve_symlinks %} - \command pwd -P +if \command -v cygpath >/dev/null +then + __zoxide_pwd() { + \command cygpath -w "$({{ pwd }})" + } +else + __zoxide_pwd() { + {{ pwd }} + } +fi {%- else %} - \command pwd -L -{%- endif %} +__zoxide_pwd() { + {{ pwd }} } +{%- endif %} # cd + custom logic based on the value of _ZO_ECHO. __zoxide_cd() { diff --git a/templates/zsh.txt b/templates/zsh.txt index 80cd428..a66f960 100644 --- a/templates/zsh.txt +++ b/templates/zsh.txt @@ -9,12 +9,16 @@ # pwd based on the value of _ZO_RESOLVE_SYMLINKS. function __zoxide_pwd() { +{%- let pwd -%} +{%- if resolve_symlinks -%} +{%- let pwd = "\\builtin pwd -P" -%} +{%- else -%} +{%- let pwd = "\\builtin pwd -L" -%} +{%- endif -%} {%- if cfg!(windows) %} - \command cygpath -w "$(\builtin pwd -P)" -{%- else if resolve_symlinks %} - \builtin pwd -P + \command cygpath -w "{{ pwd }}" {%- else %} - \builtin pwd -L + {{ pwd }} {%- endif %} } From d208a66f585daff115424fa44a2afe254879aa34 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Sat, 7 Feb 2026 11:59:53 +0530 Subject: [PATCH 13/20] install.sh: early exit on error --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 3108dd4..ba894c3 100755 --- a/install.sh +++ b/install.sh @@ -19,7 +19,7 @@ main() { parse_args "$@" local _arch - _arch="${ARCH:-$(ensure get_architecture)}" + _arch="${ARCH:-$(get_architecture)}" || exit $? assert_nz "${_arch}" "arch" echo "Detected architecture: ${_arch}" @@ -36,7 +36,7 @@ main() { # Download and extract zoxide. local _package - _package="$(ensure download_zoxide "${_arch}")" + _package="$(download_zoxide "${_arch}")" || exit $? assert_nz "${_package}" "package" echo "Downloaded package: ${_package}" case "${_package}" in From ce469159012efac2c4e005c6023e7f730ba65047 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Sat, 7 Feb 2026 12:15:06 +0530 Subject: [PATCH 14/20] install.sh: Prefix global variables --- install.sh | 62 +++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/install.sh b/install.sh index ba894c3..39ff854 100755 --- a/install.sh +++ b/install.sh @@ -19,7 +19,7 @@ main() { parse_args "$@" local _arch - _arch="${ARCH:-$(get_architecture)}" || exit $? + _arch="${_ZOXIDE_ARCH:-$(get_architecture)}" || exit $? assert_nz "${_arch}" "arch" echo "Detected architecture: ${_arch}" @@ -54,44 +54,44 @@ main() { esac # Install binary. - ensure try_sudo mkdir -p -- "${BIN_DIR}" - ensure try_sudo cp -- "${_bin_name}" "${BIN_DIR}/${_bin_name}" - ensure try_sudo chmod +x "${BIN_DIR}/${_bin_name}" - echo "Installed zoxide to ${BIN_DIR}" + ensure try_sudo mkdir -p -- "${_ZOXIDE_BIN_DIR}" + ensure try_sudo cp -- "${_bin_name}" "${_ZOXIDE_BIN_DIR}/${_bin_name}" + ensure try_sudo chmod +x "${_ZOXIDE_BIN_DIR}/${_bin_name}" + echo "Installed zoxide to ${_ZOXIDE_BIN_DIR}" # Install manpages. - ensure try_sudo mkdir -p -- "${MAN_DIR}/man1" - ensure try_sudo cp -- "man/man1/"* "${MAN_DIR}/man1/" - echo "Installed manpages to ${MAN_DIR}" + ensure try_sudo mkdir -p -- "${_ZOXIDE_MAN_DIR}/man1" + ensure try_sudo cp -- "man/man1/"* "${_ZOXIDE_MAN_DIR}/man1/" + echo "Installed manpages to ${_ZOXIDE_MAN_DIR}" # Print success message and check $PATH. echo "" echo "zoxide is installed!" - if ! echo ":${PATH}:" | grep -Fq ":${BIN_DIR}:"; then - echo "Note: ${BIN_DIR} is not on your \$PATH. zoxide will not work unless it is added to \$PATH." + if ! echo ":${PATH}:" | grep -Fq ":${_ZOXIDE_BIN_DIR}:"; then + echo "Note: ${_ZOXIDE_BIN_DIR} is not on your \$PATH. zoxide will not work unless it is added to \$PATH." fi } # Parse the arguments passed and set variables accordingly. parse_args() { - BIN_DIR_DEFAULT="${HOME}/.local/bin" - MAN_DIR_DEFAULT="${HOME}/.local/share/man" - SUDO_DEFAULT="sudo" + _ZOXIDE_BIN_DIR_DEFAULT="${HOME}/.local/bin" + _ZOXIDE_MAN_DIR_DEFAULT="${HOME}/.local/share/man" + _ZOXIDE_SUDO_DEFAULT="sudo" - BIN_DIR="${BIN_DIR_DEFAULT}" - MAN_DIR="${MAN_DIR_DEFAULT}" - SUDO="${SUDO_DEFAULT}" + _ZOXIDE_BIN_DIR="${_ZOXIDE_BIN_DIR_DEFAULT}" + _ZOXIDE_MAN_DIR="${_ZOXIDE_MAN_DIR_DEFAULT}" + _ZOXIDE_SUDO="${_ZOXIDE_SUDO_DEFAULT}" while [ "$#" -gt 0 ]; do case "$1" in - --arch) ARCH="$2" && shift 2 ;; - --arch=*) ARCH="${1#*=}" && shift 1 ;; - --bin-dir) BIN_DIR="$2" && shift 2 ;; - --bin-dir=*) BIN_DIR="${1#*=}" && shift 1 ;; - --man-dir) MAN_DIR="$2" && shift 2 ;; - --man-dir=*) MAN_DIR="${1#*=}" && shift 1 ;; - --sudo) SUDO="$2" && shift 2 ;; - --sudo=*) SUDO="${1#*=}" && shift 1 ;; + --arch) _ZOXIDE_ARCH="$2" && shift 2 ;; + --arch=*) _ZOXIDE_ARCH="${1#*=}" && shift 1 ;; + --bin-dir) _ZOXIDE_BIN_DIR="$2" && shift 2 ;; + --bin-dir=*) _ZOXIDE_BIN_DIR="${1#*=}" && shift 1 ;; + --man-dir) _ZOXIDE_MAN_DIR="$2" && shift 2 ;; + --man-dir=*) _ZOXIDE_MAN_DIR="${1#*=}" && shift 1 ;; + --sudo) _ZOXIDE_SUDO="$2" && shift 2 ;; + --sudo=*) _ZOXIDE_SUDO="${1#*=}" && shift 1 ;; -h | --help) usage && exit 0 ;; *) err "Unknown option: $1" ;; esac @@ -119,9 +119,9 @@ ${_text_heading}Usage:${_text_reset} ${_text_heading}Options:${_text_reset} --arch Override the architecture identified by the installer [current: ${_arch}] - --bin-dir Override the installation directory [default: ${BIN_DIR_DEFAULT}] - --man-dir Override the manpage installation directory [default: ${MAN_DIR_DEFAULT}] - --sudo Override the command used to elevate to root privileges [default: ${SUDO_DEFAULT}] + --bin-dir Override the installation directory [default: ${_ZOXIDE_BIN_DIR_DEFAULT}] + --man-dir Override the manpage installation directory [default: ${_ZOXIDE_MAN_DIR_DEFAULT}] + --sudo Override the command used to elevate to root privileges [default: ${_ZOXIDE_SUDO_DEFAULT}] -h, --help Print help" } @@ -176,19 +176,19 @@ try_sudo() { fi need_sudo - "${SUDO}" "$@" + "${_ZOXIDE_SUDO}" "$@" } need_sudo() { - if ! check_cmd "${SUDO}"; then + if ! check_cmd "${_ZOXIDE_SUDO}"; then err "\ -could not find the command \`${SUDO}\` needed to get permissions for install. +could not find the command \`${_ZOXIDE_SUDO}\` needed to get permissions for install. If you are on Windows, please run your shell as an administrator, then rerun this script. Otherwise, please run this script as root, or install \`sudo\`." fi - if ! "${SUDO}" -v; then + if ! "${_ZOXIDE_SUDO}" -v; then err "sudo permissions not granted, aborting installation" fi } From f3a07cd3d199d464ff1a65c8df17ab382e17e5e4 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Thu, 19 Feb 2026 01:04:43 +0530 Subject: [PATCH 15/20] Update README.md --- README.md | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b397f82..ed45205 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,28 @@ Special thanks to: - -
Sponsored by Warp
-
Warp, built for coding with multiple AI agents.
-
Available for macOS, Linux, and Windows.
-
- Visit - warp.dev - to learn more. -
+ + + + + +
+ + Sponsored by Warp +
Warp, built for coding with multiple AI agents.
+
Available for macOS, Linux, and Windows.
+
+ Visit + warp.dev + to learn more. +
+
+ + Sponsored by Recall.ai +
Processing over 3TB/s of video at peak load,
+ + +

From f07a76e115ed47677b6ee0428226e6bde62ad4e0 Mon Sep 17 00:00:00 2001 From: Chawye Hsu Date: Sun, 1 Mar 2026 15:13:50 +0800 Subject: [PATCH 16/20] pwsh: handling `z ~` and `z` separately (#1161) * pwsh: handling `z ~` and `z` separately This patch enables the capability of navigating to the current user's home directory with `z` when cwd is on a PSDrive that does not have a definition of the `HOME` location. Context: The fact that `~` can be counterintuitive on PowerShell, as it's relative to the cwd, **and its value is defined with a `.Home` property of cwd's PSProvider\[1]. Not all PSProviders however define this property, leaving that sometimes you cannot navigate to the undefined `HOME` location with `~`. To validate this, you can use `Get-PSDrive` to iterate your PSDrives and see which providers define a `Home` property. On Windows, ```plain Get-PSDrive C,HKLM | select Name,{$_.Provider.Name},{$_.Provider.Home} Name $_.Provider.Name $_.Provider.Home ---- ---------------- ---------------- C FileSystem C:\Users\ HKLM Registry ``` or on Linux/macOS, ```plain Get-PSDrive /,Function | select Name,{$_.Provider.Name},{$_.Provider.Home} Name $_.Provider.Name $_.Provider.Home ---- ---------------- ---------------- / FileSystem /Users/ Function Function ``` When cwd is on a PSDrive without a defined `HOME` location, the original `Set-Location` alias `cd` in PowerShell handles this case by falling back to the user's home directory when no argument is provided\[2], and when `~` is explicitly provided, it results in an error. ```plain PS C:\> Set-Location Function: PS Function:\> cd ~ Home location for this provider is not set. To set the home location, call "(get-psprovider 'Function').Home = 'path'". PS Function:\> cd PS C:\Users\\> ``` This patch implements the same behavior for `z` by handling `z ~` and `z` separately. \[1]: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_providers \[2]: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-location?#-path Signed-off-by: Chawye Hsu * No explicit case needed for ~ --------- Signed-off-by: Chawye Hsu Co-authored-by: Ajeet D'Souza <98ajeet@gmail.com> --- templates/powershell.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/powershell.txt b/templates/powershell.txt index 046061c..bc877c0 100644 --- a/templates/powershell.txt +++ b/templates/powershell.txt @@ -28,7 +28,11 @@ function global:__zoxide_pwd { # cd + custom logic based on the value of _ZO_ECHO. function global:__zoxide_cd($dir, $literal) { $dir = if ($literal) { - Set-Location -LiteralPath $dir -Passthru -ErrorAction Stop + if ($null -eq $dir) { + Set-Location + } else { + Set-Location -LiteralPath $dir -Passthru -ErrorAction Stop + } } else { if ($dir -eq '-' -and ($PSVersionTable.PSVersion -lt 6.1)) { Write-Error "cd - is not supported below PowerShell 6.1. Please upgrade your version of PowerShell." @@ -101,7 +105,7 @@ if ($global:__zoxide_hooked -ne 1) { # Jump to a directory using only keywords. function global:__zoxide_z { if ($args.Length -eq 0) { - __zoxide_cd ~ $true + __zoxide_cd $null $true } elseif ($args.Length -eq 1 -and ($args[0] -eq '-' -or $args[0] -eq '+')) { __zoxide_cd $args[0] $false From e10ebcc2bdc15da33548a70f7a0ee873ae78d240 Mon Sep 17 00:00:00 2001 From: "Helmut K. C. Tessarek" Date: Sun, 1 Mar 2026 02:32:36 -0500 Subject: [PATCH 17/20] ci: add workflow to publish to crates.io (#1169) Thanks! --- .github/workflows/cd.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..0c979a7 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,16 @@ +name: Continuous Deployment +on: + push: + tags: + - "v*.*.*" +jobs: + publish-crates-io: + name: Publish on crates.io + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v5 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Publish + run: cargo publish --token ${{ secrets.CARGO_TOKEN }} From a461c9585f92759b86ed51e67488840ee14cd93b Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Sun, 1 Mar 2026 13:57:43 +0530 Subject: [PATCH 18/20] Update README --- README.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ed45205..29330cb 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,6 @@ to learn more. - - - Sponsored by Recall.ai -
Processing over 3TB/s of video at peak load,
- - - @@ -235,7 +228,7 @@ zoxide can be installed in 4 easy steps: > eval (zoxide init elvish | slurp) > ``` > - > **Note** + > **Note:** > zoxide only supports elvish v0.18.0 and above. @@ -269,7 +262,7 @@ zoxide can be installed in 4 easy steps: > source ~/.zoxide.nu > ``` > - > **Note** + > **Note:** > zoxide only supports Nushell v0.89.0+. @@ -335,12 +328,16 @@ zoxide can be installed in 4 easy steps: + > **Note:** + > [Warp Terminal] users need to set `Input Type` to `Shell (PS1)` under + > `Settings > Appearance > Input` for completions to work. + 3. **Install fzf** (optional) [fzf] is a command-line fuzzy finder, used by zoxide for completions / interactive selection. It can be installed from [here][fzf-installation]. - > **Note** + > **Note:** > The minimum supported fzf version is v0.51.0. 4. **Import your data** (optional) @@ -567,6 +564,7 @@ Environment variables[^2] can be used for configuration. They must be set before [ubuntu packages]: https://packages.ubuntu.com/jammy/zoxide [vim]: https://github.com/vim/vim [void linux packages]: https://github.com/void-linux/void-packages/tree/master/srcpkgs/zoxide +[warp terminal]: https://www.warp.dev [wiki-env]: https://github.com/ajeetdsouza/zoxide/wiki/HOWTO:-set-environment-variables "HOWTO: set environment variables" [xplr]: https://github.com/sayanarijit/xplr [xxh-plugin-prerun-zoxide]: https://github.com/xxh/xxh-plugin-prerun-zoxide From fb1495b0ad75b69aba98bf3e39d3cce06059ef3a Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Sun, 1 Mar 2026 15:32:40 +0530 Subject: [PATCH 19/20] Handle prompts ending in space (#1189) --- templates/bash.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/bash.txt b/templates/bash.txt index 86a2884..068ebea 100644 --- a/templates/bash.txt +++ b/templates/bash.txt @@ -63,7 +63,7 @@ if [[ ${PROMPT_COMMAND:=} != *'__zoxide_hook'* ]]; then PROMPT_COMMAND=("${PROMPT_COMMAND[@]}" __zoxide_hook) else # shellcheck disable=SC2128,SC2178 - PROMPT_COMMAND="${PROMPT_COMMAND%"${PROMPT_COMMAND##*[![:space:]]}"}" + PROMPT_COMMAND="${PROMPT_COMMAND%"${PROMPT_COMMAND##*[![:space:];]}"}" # shellcheck disable=SC2128,SC2178 PROMPT_COMMAND="${PROMPT_COMMAND:+${PROMPT_COMMAND};}__zoxide_hook" fi From 7e4cbb83806cebd5ad60daede8d4da2192044cb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 03:32:43 +0530 Subject: [PATCH 20/20] Bump actions/checkout from 5 to 6 (#1191) Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0c979a7..debc0cf 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout the repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable - name: Publish