Compare commits

...

3 Commits

Author SHA1 Message Date
developic cf086b057d
Fish: repaint the prompt when exiting without selecting (#1257) 2026-07-20 17:35:29 +05:30
Ajeet D'Souza 670bdf21b9 Nushell: handle symlinked directories 2026-07-13 15:36:47 +05:30
Rayan Salhab 1f484a4e34
Fix MSYS2 cygpath pwd substitution (#1260)
---------

Co-authored-by: cyphercodes <cyphercodes@users.noreply.github.com>
Co-authored-by: Ajeet D'Souza <98ajeet@gmail.com>
2026-07-07 04:39:13 +05:30
6 changed files with 21 additions and 11 deletions

View File

@ -1,4 +1,4 @@
name: Continuous Deployment name: cd
on: on:
push: push:
tags: tags:

View File

@ -7,6 +7,13 @@ 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/), 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). 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.
- Nushell: `z` now handles relative paths through symlinked directories.
## [0.10.0] - 2026-07-04 ## [0.10.0] - 2026-07-04
### Added ### Added

View File

@ -16,7 +16,7 @@ function __zoxide_pwd() {
{%- let pwd = "\\builtin pwd -L" -%} {%- let pwd = "\\builtin pwd -L" -%}
{%- endif -%} {%- endif -%}
{%- if cfg!(windows) %} {%- if cfg!(windows) %}
\command cygpath -w "{{ pwd }}" \command cygpath -w "$({{ pwd }})"
{%- else %} {%- else %}
{{ pwd }} {{ pwd }}
{%- endif %} {%- endif %}

View File

@ -101,8 +101,12 @@ function __zoxide_z_complete
# If the last argument is empty, use interactive selection. # If the last argument is empty, use interactive selection.
set -l query $tokens[2..-1] set -l query $tokens[2..-1]
set -l result (command zoxide query --exclude (__zoxide_pwd) --interactive -- $query 2>/dev/null) set -l result (command zoxide query --exclude (__zoxide_pwd) --interactive -- $query 2>/dev/null)
and builtin commandline --replace -- "{{ cmd.unwrap_or("cd") }} "(string escape -- $result) if test $status -eq 0
and builtin commandline --function repaint execute builtin commandline --replace -- "{{ cmd.unwrap_or("cd") }} "(string escape -- $result)
builtin commandline --function repaint execute
else
builtin commandline --function repaint
end
end end
end end
complete --command __zoxide_z --no-files --arguments '(__zoxide_z_complete)' complete --command __zoxide_z --no-files --arguments '(__zoxide_z_complete)'

View File

@ -57,15 +57,14 @@ export-env {
# Jump to a directory using only keywords. # Jump to a directory using only keywords.
export def --env --wrapped __zoxide_z [...rest: directory] { export def --env --wrapped __zoxide_z [...rest: directory] {
let path = match $rest { match $rest {
[] => {'~'}, [] => { cd ~ },
[ '-' ] => {'-'}, [ '-' ] => { cd - },
[ $arg ] if ($arg | path expand | path type) == 'dir' => {$arg} [ $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 %} {%- if echo %}
echo $env.PWD echo $env.PWD
{%- endif %} {%- endif %}

View File

@ -16,7 +16,7 @@ function __zoxide_pwd() {
{%- let pwd = "\\builtin pwd -L" -%} {%- let pwd = "\\builtin pwd -L" -%}
{%- endif -%} {%- endif -%}
{%- if cfg!(windows) %} {%- if cfg!(windows) %}
\command cygpath -w "{{ pwd }}" \command cygpath -w "$({{ pwd }})"
{%- else %} {%- else %}
{{ pwd }} {{ pwd }}
{%- endif %} {%- endif %}