From 1f484a4e344e819ce3b537fc6f80ada8a78c687a Mon Sep 17 00:00:00 2001 From: Rayan Salhab Date: Tue, 7 Jul 2026 02:09:13 +0300 Subject: [PATCH] Fix MSYS2 cygpath pwd substitution (#1260) --------- Co-authored-by: cyphercodes Co-authored-by: Ajeet D'Souza <98ajeet@gmail.com> --- CHANGELOG.md | 6 ++++++ templates/bash.txt | 2 +- templates/zsh.txt | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c803fd..d57588e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ 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] + +### Fixed + +- Bash/Zsh: fix `z` failing on Cygwin/MSYS2 due to `cygpath` being passed a bad string. + ## [0.10.0] - 2026-07-04 ### Added diff --git a/templates/bash.txt b/templates/bash.txt index e5df5c7..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 %} diff --git a/templates/zsh.txt b/templates/zsh.txt index c72178f..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 %}