bashvisual-studio-code

VSCode Integrated Terminal creates a separate window


Just installed VSCode and git bash.

I've added the following lines to the settings.json file:

{
    "terminal.integrated.shell.windows": "D:\\Program Files\\Git\\git-bash.exe" 
}

When I press Ctr+` to open the integrated shell window, instead of opening inside the main editor at the bottom it opens a new window:

Git Bash Winow

Why isn't it showing in the usual place?


Solution

  • According to this vscoode GitHub Issue (#7286):

    ... git-bash.exe is a Windows application (with WinMain as entry), but bash.exe is a console application (with main as entry). To be used as integrated shell, the executable must be a console application, so that stdin/stdout/stderr can be redirected.


    CAUTION
    Since the original question was posted (over 7 years ago), "Git Bash" was added as a default profile. The configuration below will replace the default profile.

    As of April 2021 (v1.56), the recommended approach is to use:

    "terminal.integrated.profiles.windows": {
      "Git Bash": {
        "path": "C:\\Path\\To\\Git\\bin\\bash.exe"
      },
      // ... additional profiles
    }
    

    To set Git Bash as the default profile, use the following:

    "terminal.integrated.defaultProfile.windows": "Git Bash"