Flux
Flux

Reputation: 666

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?

Upvotes: 5

Views: 13386

Answers (1)

Flux
Flux

Reputation: 666

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.

Upvotes: 22

Related Questions