After reading this inspiring answer and asking the launcher for help,
$> c:\msys64\msys2_shell.cmd -help
Usage:
msys2_shell.cmd [options] [login shell parameters]
Options:
-mingw32 | -mingw64 | -ucrt64 | -clang64 | -msys[2] Set shell type
-defterm | -mintty | -conemu Set terminal type
-here Use current directory as working
directory
-where DIRECTORY Use specified DIRECTORY as working
directory
-[use-]full-path Use full current PATH variable
instead of trimming to minimal
-no-start Do not use "start" command and
return login shell resulting
errorcode as this batch file
resulting errorcode
-shell SHELL Set login shell
-help | --help | -? | /? Display this help and exit
Any parameter that cannot be treated as valid option and all
following parameters are passed as login shell command parameters.
I solved this issue like this for an up-to-date MSYS2 installation on Windows10/11 (in 2024):
Create a file msys.cmd
in my tools
folder (this folder is in %PATH%
) with following contents.
set MSYSTEM=UCRT64
c:\msys64\msys2_shell.cmd -here %*
This will default to the nowadays encouraged UCRT64
but will as well pass arguments like -mingw64
(which are higher priority) to the launcher, so not much to remember.
%cd%
) to them somehow, but I'm not sure.