Git Bash is not showing up as a terminal option in VSCode

Viewed 6477

I'm running windows 10 trying to get a git bash terminal set up but VSCode isn't detecting the installation of Git or something?

I was looking at how to set it up, by doing "select default shell" in the terminal window, then selecting Git Bash, but it's not an option for me. VSCode and Git have both been installed normally so I don't get why this is happening?

Do I need to reinstall both these applications? I would rather not...Any suggestions?

3 Answers

I recommend that you put something like the following in your VS Code settings file (using the appropriate path for your system).

"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\git-cmd.exe",
"terminal.integrated.shellArgs.windows": [
  "--command=usr/bin/bash.exe",
  "-l",
  "-i"
]

This is discussed at https://code.visualstudio.com/docs/editor/integrated-terminal#_windows.

You may also need to put something like this in your ~/.bash_profile:

## make Backspace key and other things work in VS Code's Terminal emulator
export TERM=xterm

I've written about this and more at https://www.ii.com/git-bash-is-my-preferred-windows-shell/

You could check your %PATH% first: I don't have any issue with VSCode detecting Git when git.exe is in the %PATH%

If not, try and set Git: Path in the VSCode user setting (you need to enter the full path of the git.exe, inclusing git.exe itself)

If anyone is still struggling with it, see this answer

In my case the VSCode and Bash were installed on the D drive and for some reason VS was not detecting bash.

Related