5

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?

1 Answer 1

22

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.

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

1 Comment

For those who cannot use bash aliases in vscode in windows, adding "terminal.integrated.shellArgs.windows": ["--login","-i"] in settings worked. Make sure to F1> Reload Window after you do.

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.