I am running Windows Terminal and Git Bash on my machine. I want to integrate Git Bash into Windows Terminal, but I want to set the environment variable MSYS_NO_PATHCONV=1
when running Git Bash via Windows Terminal.
I do not want to add this to my system environment variables, because I want to be able to start Git Bash outside of Windows Terminal without this environment variable.
To add Git Bash to Windows Terminal, I have created the following entry in Windows Terminal's profiles.json file:
{
"guid": "{3a20b825-3d22-41ed-b575-9006741aff64}",
"name": "Git Bash",
"commandline": "C:\\Program Files\\Git\\usr\\bin\\bash.exe",
"icon": "C:/Program Files/Git/mingw64/share/git/git-for-windows.ico",
"startingDirectory": "~",
"hidden": false
}
Here is what I have tried so far to get the environment variable to Git Bash:
MSYS_NO_PATHCONV=1 "commandline": "C:\\Program Files\\Git\\usr\\bin\\bash.exe",
. This just results in an error message and does not start Git Bash.set
command on Windows, then runs Git Bash. This doesn't open Git Bash and instead just opens a regular cmd terminal in which the commands from the batch file are executed.Is there any way that I can start my Git Bash in Windows Terminal with my custom environment variable without adding it to the system's environment variables?
"commandline": "cmd.exe /C \"set MSYS_NO_PATHCONV=1 && \"C:\\Program Files\\Git\\bin\\bash.exe\"\"",
Or append export MSYS_NO_PATHCONV=1
to ~/.bashrc
.