"terminal.integrated.profiles.windows": {
"PowerShell": { "source": "PowerShell", "icon": "terminal-powershell" },
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"icon": "terminal-cmd"
},
"GitBash": {
"path": ["C:\\Program Files\\Git\\bin\\bash.exe"],
"source": "Git Bash",
"icon": "terminal-bash"
},
"terminal.integrated.defaultProfile.windows": "GitBash",
As of April 2021 "terminal.integrated.shell.windows" is deprecated in VSCode.
"terminal.integrated.shell.windows": "C:\\...\\...\\bin\\bash.exe",
To configure Git Bash as the default integrated terminal in VSCode version 1.56 on Windows 10
Step 1: Open command palette (CMD + Shift + P)
Step 2: Search "Preferences: Open User Settings (JSON)"
Step 3: Create a new field by typing "" (double quotation key). Inside the quotation type "terminal." a list of options will appear.
Step 4: Select terminal.integrated.profiles.windows
. When you select terminal.integrated.profiles.windows
it will be expanded to:
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"GitBash": {
"source": "Git Bash",
"path": ["C:\\Program Files\\Git\\bin\\bash.exe"],
"icon": "terminal-bash"
}
},
Step 5: Set default terminal to Git Bash
"terminal.integrated.defaultProfile.windows": "GitBash",
IMPORTANT
The defaultProfile.windows value must be one word to work.
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"icon": "terminal-cmd"
},
"Git Bash": {
"path": ["C:\\Program Files\\Git\\bin\\bash.exe"],
"source": "Git Bash",
"icon": "terminal-bash"
},
},
"terminal.integrated.defaultProfile.windows": "Git Bash",
Does not work!
// End
Documentation:
- VSCode version 1.56 Release Notes https://code.visualstudio.com/docs/editor/integrated-terminal#_windows
- Troubleshoot Terminal launch failures
Top comments (18)
Check the bracets make sure they are properly aligned.
Hi,
In case you have not been able to resolve your default shell in vs code, i updated mine today using the following:
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\Sysnative\cmd.exe",
"${env:windir}\System32\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash"
}
},
"terminal.integrated.defaultProfile.windows": "Git Bash",
This worked for me. My default shell is now Git Bash.
Further note:
Originally, there were settings in my JSHint extention configurations as follows:
"terminal.integrated.shell.windows": "C:\Program Files\Git\bin\bash.exe",
"terminal.integrated.shellArgs.windows": [
"--login"
],
I removed this piece of original settings first.
The same question , I just replace Git Bash =》 GitBash
One more thing, before closing the editor. Make sure to hit the Delete icon to close the Powershell tab. Otherwise when you re-open the project, it won't respect the default profile you had set but instead open Powershell again.
it does not seem to work to have path and source property at the same time (see there:
stackoverflow.com/questions/680683...). i had to remove the source property to make that working. i also confirm that it doesn't work with space between git and bash.
This worked for me.
This worked for me. Had it installed on a different drive before and nothing worked.
Installed on drive (C:) and worked. Thanks.
I've found this Video Posted One month ago(08/09/2021)
works fine for me
youtube.com/watch?v=Yn-ANAtDQ_0
It doesnot work for me. I still have powershell as default shell.
@kadiryumlu try this:
{
"terminal.external.windowsExec": "",
"terminal.explorerKind": "external",
"terminal.integrated.cwd": "C:\Users\%USERNAME%",
"php.validate.executablePath": "C:\xampp\php\php.exe",
"browser-preview.startUrl": "localhost/",
"phpserver.phpPath": "C:\xampp\php\php.exe",
"workbench.editor.untitled.hint": "hidden",
"workbench.colorTheme": "Visual Studio Light",
"terminal.integrated.tabs.enabled": true,
"[json]": {
}
I updated the article should work now!
Hello,
I'm on Windows 11.
I try and works for me if I call the terminal "GitBash" or anyhow but not "Git Bash" with a space. Do you know why ?
Also, the attribute "source" doesn't want to works to : I must use a "path" attribute. Have you any idea why too ?
Thank's very much !!
Seb
Thanks! :)
Thanks for the tip!