Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 369
DCardinal Avatar asked May 30 '20 22:05

DCardinal


People also ask

Can I use Git Bash as a terminal?

Git Bash is offered to provide a terminal Git experience.

How do I set Git Bash as default terminal in VS code?

Another way to select a default terminal is to open up a new terminal in VS Code. Next to the big plus sign, click on the dropdown and select “Select Default Profile“. From the dropdown select “Git Bash” and you're all set. Reopen a new terminal to make sure Git Bash opens up as default.


2 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

like image 78
albertony Avatar answered Sep 20 '22 14:09

albertony


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

enter image description here

like image 24
TimH Avatar answered Sep 19 '22 14:09

TimH