z
z copied to clipboard
Ignore case on Cygwin and MSYS ?
When I was using z.sh on my Cygwin, I found one path has two or more difference history entries:
linwei@weilin0:/cygdrive/d/acm/github/vim/lib% z
0.5 /cygdrive/d/acm/github/vim
0.5 /cygdrive/d/ACM/github/vim
0.5 /cygdrive/D/ACM/github/vim
.....
A lot of this in my z path history, is it possible to be fixed ? Can z.sh runs in a case insensitive mode ?
z.sh could add here an additional pre-command to make the directory path lower-case on Windows, such as:
case $(uname | tr '[:upper:]' '[:lower:]') in
cygwin*|mingw*|msys*)
dir="$(echo "$*" | tr '[:upper:]' '[:lower:])"
;;
*)
dir="$*"
;;
Running uname each time is costly, whence its output could be used to set an environment variable $_Z_CASE.
(On Git Bash/MSYS, one could check whether "$MSYSTEM" is present instead.)
@Konfekt , thanks, despite that I created a new tool https://github.com/skywind3000/z.lua, and have switched to it.