Setting Up MSYS2 as Default Terminal
Download and install MSYS2: https://www.msys2.org/ .
Open MSYS2 and run pacman -Syu
to update packages.
Open file explorer and go to C:\msys64
.
Open all the INI files for the systems (clang32.ini
, clang64.ini
, mingw32.ini
, mingw64.ini
, msys2.ini
) and uncomment the MSYS2_PATH_TYPE=inherit
line. This allows the Windows $PATH variable to be included in the shells.
Download and install Windows Terminal from the Windows store.
Open the settings for Windows Terminal and click "Open JSON".
Copy and paste the following objects into the "list" array under "profiles":
{
"commandline" : "C:/msys64/msys2_shell.cmd -defterm -here -no-start -clang64 -use-full-path" ,
"font" :
{
"face" : "Lucida Console" ,
"size" : 15
} ,
"guid" : "{8629afd6-5d0e-406c-a523-d26a47398b26}" ,
"hidden" : true ,
"icon" : "C:/msys64/mingw64.ico" ,
"name" : "CLANG64 / MSYS2" ,
"startingDirectory" : "C:/Users/%USERNAME%/Developer"
} ,
{
"commandline" : "C:/msys64/msys2_shell.cmd -defterm -here -no-start -clang32 -use-full-path" ,
"font" :
{
"face" : "Lucida Console" ,
"size" : 15
} ,
"guid" : "{b1feb804-7dd2-48da-be0e-f24db4bbd880}" ,
"hidden" : true ,
"icon" : "C:/msys64/mingw32.ico" ,
"name" : "CLANG32 / MSYS2" ,
"startingDirectory" : "C:/Users/%USERNAME%/Developer"
} ,
{
"commandline" : "C:/msys64/msys2_shell.cmd -defterm -here -no-start -mingw64 -use-full-path" ,
"font" :
{
"face" : "Lucida Console" ,
"size" : 15
} ,
"guid" : "{17da3cac-b318-431e-8a3e-7fcdefe6d114}" ,
"hidden" : true ,
"icon" : "C:/msys64/mingw64.ico" ,
"name" : "MINGW64 / MSYS2" ,
"startingDirectory" : "C:/Users/%USERNAME%/Developer"
} ,
{
"commandline" : "C:/msys64/msys2_shell.cmd -defterm -here -no-start -mingw32 -use-full-path" ,
"font" :
{
"face" : "Lucida Console" ,
"size" : 15
} ,
"guid" : "{2d51fdc4-a03b-4efe-81bc-722b7f6f3820}" ,
"hidden" : true ,
"icon" : "C:/msys64/mingw32.ico" ,
"name" : "MINGW32 / MSYS2" ,
"startingDirectory" : "C:/Users/%USERNAME%/Developer"
} ,
{
"commandline" : "C:/msys64/msys2_shell.cmd -defterm -here -no-start -msys -use-full-path" ,
"font" :
{
"face" : "Lucida Console" ,
"size" : 15
} ,
"guid" : "{863375d3-ac24-4169-a605-88a63c2cf5bc}" ,
"icon" : "C:/msys64/msys2.ico" ,
"name" : "MSYS / MSYS2" ,
"startingDirectory" : "C:/Users/%USERNAME%/Developer"
} ,
{
"commandline" : "C:/msys64/msys2_shell.cmd -defterm -here -no-start -ucrt64 -use-full-path" ,
"font" :
{
"face" : "Lucida Console" ,
"size" : 15
} ,
"guid" : "{71160544-14d8-4194-af25-d05feeac7233}" ,
"icon" : "C:/msys64/msys2.ico" ,
"name" : "UCRT64 / MSYS2" ,
"startingDirectory" : "C:/Users/%USERNAME%/Developer"
} ,
Change default terminal to one of the profiles.
Open VS Code and open the settings in JSON
Under terminal.integrated.profiles.windows
(create if not existing as an object), add the following:
"msys2" : {
"path" : "C:/msys64/usr/bin/bash.exe" ,
"args" : [ "--login" ] ,
"env" : {
"CHERE_INVOKING" : "1" ,
"MSYSTEM" : "UCRT64" ,
"MSYS2_PATH_TYPE" : "inherit"
}
}
Under terminal.integrated.defaultProfile.windows
(create if not existing as a string), set to "msys2"
If clang64
, mingw64
, or other is needed, copy-paste the profile and change "MSYSTEM".
Go into the settings for Windows and change default terminal to Windows Terminal.