Fix Windows paths on Fish+Cygwin

This commit is contained in:
Ajeet D'Souza 2022-04-26 20:10:27 +05:30
parent f628845fb7
commit 6b2c6a2bc3
4 changed files with 18 additions and 4 deletions

View File

@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fzf: show preview window below results.
### Fixed
- Fish: fix paths on Cygwin.
## [0.8.1] - 2021-04-23
### Changed

View File

@ -7,7 +7,9 @@
# pwd based on the value of _ZO_RESOLVE_SYMLINKS.
function __zoxide_pwd() {
{%- if resolve_symlinks %}
{%- if cfg!(windows) %}
\command cygpath -w "$(\builtin pwd -P)"
{%- else if resolve_symlinks %}
\builtin pwd -P
{%- else %}
\builtin pwd -L

View File

@ -7,7 +7,9 @@
# pwd based on the value of _ZO_RESOLVE_SYMLINKS.
function __zoxide_pwd
{%- if resolve_symlinks %}
{%- if cfg!(windows) %}
command cygpath -w (builtin pwd -P)
{%- else if resolve_symlinks %}
builtin pwd -P
{%- else %}
builtin pwd -L
@ -26,7 +28,11 @@ end
# cd + custom logic based on the value of _ZO_ECHO.
function __zoxide_cd
{%- if cfg!(windows) %}
__zoxide_cd_internal (cygpath -u $argv)
{%- else %}
__zoxide_cd_internal $argv
{%- endif %}
{%- if echo %}
and __zoxide_pwd
{%- endif %}
@ -83,7 +89,7 @@ function __zoxide_z_complete
# If the last argument is empty, use interactive selection.
set -l query $tokens[2..-1]
set -l result (zoxide query -i -- $query)
commandline --current-process "$tokens[1] "(string escape $result)
and commandline --current-process "$tokens[1] "(string escape $result)
commandline --function repaint
end
end

View File

@ -7,7 +7,9 @@
# pwd based on the value of _ZO_RESOLVE_SYMLINKS.
function __zoxide_pwd() {
{%- if resolve_symlinks %}
{%- if cfg!(windows) %}
\command cygpath -w "$(\builtin pwd -P)"
{%- else if resolve_symlinks %}
\builtin pwd -P
{%- else %}
\builtin pwd -L