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?

2
  • You may be able to do this by changing the default terminal to Git Bash. Commented Mar 22, 2022 at 11:58
  • Hi @JeffMartin, that's for VS Code, rather than Visual Studio 2022 Commented Mar 22, 2022 at 11:59

2 Answers 2

15

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.

Sign up to request clarification or add additional context in comments.

Comments

5

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.