Can I force Visual Studio 2022 > Git > Open In Command Prompt to use Git Bash instead of cmd?

Viewed 1314

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?

2 Answers

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.

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.

Related