Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 424
naossoan Avatar asked Jan 12 '21 00:01

naossoan


People also ask

Why Git bash is not showing on VS Code?

Show activity on this post. The solution is to uninstall git and reinstall it in the default location which is (C:\Program Files\Git). All the other hacks failed.

How do I get bash terminal in VS Code?

Second way 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.

Why is VS Code not showing terminal?

If your terminal is set to run as administrator only, and you are not launching VS Code as administrator, the terminal will not be able to open. You can either change the default terminal or edit the properties of the terminal exe to not run as administrator.


1 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/

like image 197
n m Avatar answered Oct 05 '22 07:10

n m