1

So I am fairly new to pretty much everything.

I follow Brad from YT channel Traversy Media and am adapting his stack - slowly but surely.

I use VS Code as my editor and Git Bash as my terminal.

When he or anyone else I find on Google use bash in VS Code it always opens internally.

VS Code offers a shortcut Ctrl+Shift+C to open it externally and a shortcut Ctrl+` (or in my case Ctrl+F1) to open it internally.

In my case it opens it externally with both shortcuts as well as with menu View->Terminal.

In VS Code it still takes up space at bottom meant for the terminal, except I can't type anything in it. It looks like this: Two internally opened "terminals" with split view in VS Code (and this only happens when I open them internally. If I open them externally, they just open as you'd expect, without opening these useless panel at the bottom of VS Code.

It instead opens them like this: Both opened externally

My JSON Settings are these:

{
  "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
  "terminal.external.windowsExec": "C:\\Program Files\\Git\\bin\\bash.exe",
  "workbench.colorTheme": "Monokai",
  "workbench.colorCustomizations": {
    "[Monokai]": {
      "tab.activeBackground": "#999999",
      "tab.activeForeground": "#333333"
    }
  },
  "emmet.triggerExpansionOnTab": true,
  "editor.fontSize": 14,
  "editor.wordWrap": "on",
  "editor.codeActionsOnSave": {},
  "editor.tabSize": 2,
  "php.suggest.basic": false,
  "php.validate.executablePath": "C:\\xampp\\php\\php.exe", //for linting
  "php.validate.run": "onSave", //change to onType if need be
  "explorer.confirmDelete": false,
  "beautify.language": {
    "js": {
      "type": [
        "javascript",
        "json",
        "jsonc"
      ],
      "filename": [
        ".jshintrc",
        ".jsbeautifyrc"
      ]
    },
    "css": [
      "css",
      "scss"
    ],
    "html": [
      "htm",
      "html"
    ]
  },
  "beautify.config": {
    "indent_size": 2,
    "indent_char": " ",
    "css": {
      "indent_size": 2
    }
  },
  "window.zoomLevel": 0,
  "workbench.colorCustomizations": {
    "gitDecoration.addedResourceForeground": "#f45342",
    "gitDecoration.modifiedResourceForeground": "#3888d8"
  },
  "workbench.settings.useSplitJSON": true,
  "files.trimTrailingWhitespace": true,
  "minify.minifyExistingOnSave": true
}

Can't find the solution to this anywhere on Google..

Can anyone provide some insight?

3
  • Please elaborate. Is there a different type of formatting for text than just plain text written in directly? Or did you perhaps mean, that my "code" should not be an image?
    – s3c
    Commented Apr 10, 2019 at 8:34
  • How did you install git? Did you choose to only have MingW available or did you integrate it so you can use it from a cmd?
    – Seth
    Commented Apr 10, 2019 at 8:50
  • If I open cmd and type in bash and press Enter, it changes colorization and adds $ before input. If that doesn't answer your question, then I need to go through installation process again, since I don't remember MingW option.
    – s3c
    Commented Apr 10, 2019 at 13:48

2 Answers 2

1

It seems adding "terminal.external.windowsExec": "C:\\Program Files\\Git\\bin\\bash.exe" to Settings is the old way and doesn't work as expected.

Delete all lines related to bash from Settings JSON (check User, Workspace and Folder Settings to be sure) and save the file.

Then just open Command Palette (Ctrl + Shift + P) and type in

Select Default Shell

and choose bash from there.

Now all you have to do is restart VS Code and terminal will be running as expected.

For shells that aren't in your %PATH%, see the other answers.

See the complete Visual Studio Code shell reference.

1
  • FWIW, my error was that i was setting "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\git-bash.exe", which is the wrong .exe. It should be "terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe". Commented Apr 2, 2020 at 14:48
0

I've had this problem before, it is very simple to fix.

The issue is that you are opening a program located at:

C:\Program Files\Git\git-bash.exe

Which cannot run within VS Code. To fix it, open your settings in VS Code:

CTRL + ,

Use the search bar to filter for the word:

integrated

Look for the following setting:

Terminal>Integrated>Windows

Update the field to be:

C:\Program Files\Git\bin\bash.exe

Change your external field to:

C:\WINDOWS\System32\cmd.exe

I hope that works for you.

1
  • "terminal.external.windowsExec": "C:\\Program Files\\Git\\bin\\bash.exe", Is this what I already have in my settings not enough?
    – s3c
    Commented May 13, 2019 at 6:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .