z icon indicating copy to clipboard operation
z copied to clipboard

Ignore case on Cygwin and MSYS ?

Open skywind3000 opened this issue 7 years ago • 2 comments

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 ?

skywind3000 avatar Jan 25 '18 15:01 skywind3000

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 avatar Dec 17 '21 07:12 Konfekt

@Konfekt , thanks, despite that I created a new tool https://github.com/skywind3000/z.lua, and have switched to it.

skywind3000 avatar Dec 17 '21 08:12 skywind3000