Vscode: Terminal with Git bash

Created on 15 Jun 2016  路  11Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.2.1
  • OS Version: Windows 10 Pro

Steps to Reproduce:

  1. Change the key "terminal.integrated.shell.windows" with value "C:Program FilesGitgit-bash.exe" (path to git-bash.exe file, like as cmd or powershell)
  2. Try `Ctrl+``, gitbash show external vscode, not in terminal box. I can not type anything on terminal box (not git bash)

Most helpful comment

As commented in #10054, you can also try the below configuration:

// settings.json
{
    "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
    "terminal.integrated.shellArgs.windows": [
        "/k",
        "C:\\Program Files\\Git\\bin\\bash.exe"
    ]
}

All 11 comments

I found that same instruction somewhere, but it should be:

"terminal.integrated.shell.windows": "C:\Program Files\Git\bin\bash.exe",

Duplicate of #7286.

Yeah, thanks a lot!

As commented in #10054, you can also try the below configuration:

// settings.json
{
    "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
    "terminal.integrated.shellArgs.windows": [
        "/k",
        "C:\\Program Files\\Git\\bin\\bash.exe"
    ]
}

@jamiebarrow not worked for me. It seems the shell args not executed.

"terminal.integrated.shell.windows": "C:\\Windows\\system32\\cmd.exe", "terminal.integrated.shellArgs.windows": [ "/k", "E:\\Program Files\\Git\\bin\\bash.exe" ]

for every windows 10 users with ubuntu terminal:
"terminal.integrated.shell.windows": "C:\Windows\sysnative\bash.exe"

Thank you.

The solution suggested by @jamiebarrow works for MSYS2 shell too. However when you exit you get to cmd and need to exit again.

My way around was opening the git bash without the cmd using :

    "terminal.integrated.shell.windows": "C:\\path_to_your_git_bash",
    "terminal.integrated.shellArgs.windows": [
      "--command=usr/bin/bash.exe",
      "-l",
      "-i"
    ]

It works pretty well and it already loads my bash_profile!

@mdocter thanks but bash.exe doesn't print with colors. For example, ls command returns all the results same color. but git-bash.exe makes the directories blue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

trstringer picture trstringer  路  3Comments

villiv picture villiv  路  3Comments

omidgolparvar picture omidgolparvar  路  3Comments

chrisdias picture chrisdias  路  3Comments

lukehoban picture lukehoban  路  3Comments