gitcmdmsys2mintty

REVISIT: How to configure the default shell in msys2/mintty?


I have the same question as this prior Stackoverflow post. I got helicoptered into this situation due to git for Windows, not MinGW or cygwin, so the answers in that post don't seem viable.

I would like to start mintty from a Windows cmd.exe prompt, but when I type mintty there, I get this dialog box:

enter image description here

I always want to use MSYS2, so how can I tell mintty to use that instead of always going through the dialog box? I've tried the various options from this page but again these all assume I'm using MinGW or cygwin, not acquiring mintty/MSYS from git. Thanks!


Solution

  • I just tried:

    mintty -o MSYSTEM=MSYS
    

    It did open immediately a MSYS2 bash.

    MSYS2 bash

    That works if Git and its Linux commands are in the PATH:

    set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
    set GH=C:\path\to\git
    set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%