How can I use a git bash terminal profile in Visual Studio 2019?

Viewed 3181

Visual Studio 2019 has recently added a new (much-needed) terminal feature in its 16.6 version. It's really great, but I'm having a hard time integrating git bash in the profiles.

I've tried a few variations of arguments and whatnot of the following profile:

Bash Profile

But whenever I try selecting that profile, the terminal shortly displays a blank screen, then opens the default PowerShell terminal.

What am I doing wrong and how can I configure the profile correctly?

4 Answers

In case you haven't figured it out already: You need to add argument -i (to make the shell interactive), and I also recommend --login (to make the shell read default profile configuration files).

Try adding the following in the Arguments field:

--login -i

I used C:\Program Files\Git\bin\bash.exe as the Shell Location, and it worked fine.

enter image description here

Solution I am using while waiting for a better one:

Shell Location: C:\WINDOWS\system32\cmd.exe Arguments: /k ""%VSAPPIDDIR%..\Tools\VsDevCmd.bat" & bash"

Essentially, I am launching cmd and running the "bash" command at launch, effectively nesting the bash terminal within cmd.

My Workaround:

What you no one mentioned in all of these replies is that you need the shell not the executable different things...

Shell Location: C:\Program Files\Git\bin\sh.exe

Arguments: (If you have any preferences add here, it works without)

And...

Walah!

How it looks in the VS2019 Terminal

Related