Open veqryn opened 7 years ago
FWIW, the MSYS2 path conversion behavior isn't part of upstream winpty -- the MSYS2 winpty package adds it -- https://github.com/Alexpux/MSYS2-packages/blob/ec549593cd9874c801b3a95106d032d23b3ac0b8/winpty/0002-fix-path-conversion.patch.
Related to https://github.com/rprichard/winpty/issues/88.
Ok, so sorry if i am a little dumb, but how do i fix it or turn it off, or who should i start poking to get it fixed or turned off?
Maybe a workaround is to use upstream winpty instead of MSYS2's packaged winpty. Longer term, those two environment variables (MSYS_NO_PATHCONV
and MSYS2_ARG_CONV_EXCL
) might be the right thing to do.
Aliases are not expected to work. They're part of your shell, and the shell won't expand an alias if it's an argument to a program. (In this case, the program is winpty
, but it could be strace
, /usr/bin/time
, etc.)
This gist is a workaround of this issue (and others): https://gist.github.com/mikeslattery/9b618669b63fe9dc984d5924bbb3aaee
A shorter less robust version could be implemented in .bashrc:
docker() {
realdocker='/c/Program Files/Docker/Docker/Resources/bin/docker'
export MSYS_NO_PATHCONV=1 MSYS2_ARG_CONV_EXCL="*"
printf "%s\0" "$@" > /tmp/args.txt
winpty bash -c "xargs -0a /tmp/args.txt '$realdocker'"
}
I am using the latest version that comes with Git for Windows (git-bash).
I have the following environment variables and aliases set:
The MSYS_NO_PATHCONV and MSYS2_ARG_CONV_EXCL are supposed to prevent path munging on both MSYS2 and Git-Bash, and they work fine, except when using winpty.
Examples:
You can see that with normal docker I can run
/bin/bash
, but with winpty I have to use//bin/bash
otherwise the path gets mucked up and changed to a windows directory.My aliases also do not seem to carry over: