Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode Terminal + Git Bash "command not found" for any command

My settings.json is very simple, it's replacing cmd.exe with sh.exe (from git).

{
    "terminal.integrated.shell.windows": "C:\\Program Files (x86)\\Git\\bin\\sh.exe"
}

Upon opening the shell, absolutely nothing works. I can't even ls.

sh.exe"-3.1$ ls
sh.exe": ls: command not found
sh.exe"-3.1$ cd ..
sh.exe"-3.1$ ls
sh.exe": ls: command not found
sh.exe"-3.1$

Does VSCode not work with Mingw32 (git's bash)? How do I set it up to work?

like image 675
Flux Avatar asked Jan 08 '17 01:01

Flux


1 Answers

So git bash requires two arguments --login and separately -i

Thus the full json needs to look like:

{
    "terminal.integrated.shell.windows": "C:\\Program Files (x86)\\Git\\bin\\bash.exe",
    "terminal.integrated.shellArgs.windows": ["--login","-i"]
}

This will cause all commands to work in the integrated terminal.

like image 57
Flux Avatar answered Jan 04 '23 00:01

Flux