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 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 a33d039..a952e0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,24 +7,35 @@ 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 - -- Support for RISC-V (riscv64) Linux. -- `import` now supports fetching entries from `atuin`. -- `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. - -### Changed - -- `import` now auto-detects database files. -- Nushell: export commands so the init script can be imported with `use`. +## [Unreleased] ### Fixed -- Bash/Fish/POSIX/Zsh: resolve symlinks on Windows. +- 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 + +### Added + +- `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. + +### Fixed + +- 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`. - PowerShell: use fully qualified names when invoking cmdlets. @@ -580,6 +591,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 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" } diff --git a/templates/bash.txt b/templates/bash.txt index e268a9d..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 %} @@ -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}" } @@ -111,7 +115,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/nushell.txt b/templates/nushell.txt index cfeafb4..f835653 100644 --- a/templates/nushell.txt +++ b/templates/nushell.txt @@ -72,14 +72,13 @@ module zoxide_integration { # Jump to a directory using only keywords. export def --env --wrapped __zoxide_z [...rest: directory@"nu-complete __zoxide_z"] { let path = match $rest { - [] => {'~'}, - [ '-' ] => {'-'}, - [ $arg ] if ($arg | path expand | path type) == 'dir' => {$arg} + [] => { 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 %} 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)" -- "$@")" && diff --git a/templates/zsh.txt b/templates/zsh.txt index 9cdbcc2..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 %} @@ -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"