diff --git a/CHANGELOG.md b/CHANGELOG.md index ef4cf2a..de47b30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/templates/bash.txt b/templates/bash.txt index 9b3c9f4..dffd791 100644 --- a/templates/bash.txt +++ b/templates/bash.txt @@ -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 diff --git a/templates/fish.txt b/templates/fish.txt index 0403f01..6d3ed4f 100644 --- a/templates/fish.txt +++ b/templates/fish.txt @@ -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 diff --git a/templates/zsh.txt b/templates/zsh.txt index ded2f34..b6674b1 100644 --- a/templates/zsh.txt +++ b/templates/zsh.txt @@ -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