zoxide icon indicating copy to clipboard operation
zoxide copied to clipboard

Windows can have symlinks, should still respect `_ZO_RESOLVE_SYMLINKS`

Open cspotcode opened this issue 1 month ago • 1 comments

The logic here ignores the value of _ZO_RESOLVE_SYMLINKS on Windows, but Windows can have symlinks. https://github.com/ajeetdsouza/zoxide/blob/ecf72c9cfdc0c8f04ac1e2953bb3703ea6805e05/templates/posix.txt#L10-L19

Here is a reproducible example from my busybox.exe (ash) shell:

# Create directory and symlink to it
$ cd G:\repro
$ mkdir directory
$ ln -s directory symlink

$ cd symlink
$ pwd -L
G:/repro/symlink
$ pwd -P
G:/repro/directory

# cygpath is not available on $PATH and is not necessary in busybox.
# But for completeness, just showing that it understands the symlink, too.
$ 'C:\program files\git\usr\bin\cygpath.exe' -w $(pwd -L)
G:\repro\symlink
$ 'C:\program files\git\usr\bin\cygpath.exe' -w $(pwd -P)
G:\repro\directory

cspotcode avatar Nov 18 '25 14:11 cspotcode

Here's the reproduction in "Git Bash." It works identically except that "Git Bash" is msys / mingw, so it uses posix-style paths and does require cygpath.

$ pwd -L
/g/repro/symlink
$ pwd -P
/g/repro/directory

$ cygpath -w $(pwd -L)
G:\repro\symlink
$ cygpath -w $(pwd -P)
G:\repro\directory

cspotcode avatar Nov 18 '25 15:11 cspotcode