7

Using Visual Studio 2022, I want to use the Git menu option Open In Command Prompt to open a Git Bash terminal as opposed to cmd.exe.

How do I configure VS to do this?

StuperUser
  • 10,555
  • 13
  • 78
  • 137

2 Answers2

10

While not integrating to that menu, I was able to add git bash to the terminal window.

By choosing View > Terminal (or ctrl + ') and then selecting the settings cog and setting the following:

Git Bash settings

I am able to open a gitbash shell from within VS.

Note, that by setting the Shell location to C:\Program Files\Git\git-bash.exe, the console loads a new instance of the console in its own window, by setting it to C:\Program Files\Git\bin\sh.exe, it is integrated in the Terminal Pane.

StuperUser
  • 10,555
  • 13
  • 78
  • 137
4

Further to your own answer @StuperUser, you can set the Terminal up as follows: Git Bash Terminal

This was taken from my Windows Terminal config when it added the Git Bash profile automatically. The arguments are -i for interactive and -l for login shell.

You could also try Mads Kristensen's Open Command Line Extension - it kind of works but has some quirks.

Piers Myers
  • 10,611
  • 6
  • 46
  • 61