I tried to set Git Bash as the default terminal in VSCode, but I can't do it successfully. I've tried following the next articles:
But they haven't resolved my issue.
I managed to generate profiles in settings.json
, but Git Bash doesn't work for some reason unknown to me and VsCode shows an error.
My settings.json
:
{
"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",
"path": "C:\\git-sdk-64\\git-bash.exe",
"args": [
"--login",
"-i"
]
},
"Cygwin": {
"path": "C:\\cygwin64\\bin\\bash.exe",
"args": [
"--login"
]
}
},
"terminal.integrated.defaultProfile.windows": "Git Bash"
}
The error:
Does anyone know how to fix this?
My VsCode version:
Version: 1.57.1 (user setup)
Commit: 507ce72a4466fbb27b715c3722558bb15afa9f48
Date: 2021-06-17T13:28:07.755Z
Electron: 12.0.7
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Windows_NT x64 10.0.19042
I use git SDK, which is like git-bash but not exactly. Maybe this is the problem?
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."
The drop-down includes every shell that is installed in your system that VS Code was able to detect. Now simply select Git Bash and open up a new terminal window by pressing down CTRL + SHIFT + ~ (tilde) to check if Git Bash opens up as the default terminal.
Type the name of the profile that need to be created and press Enter Then it will open the setting page and change the path to your terminal path After struggling with this, a simple solution i found, at least in my case where git is not installed in default path, is to make a symbolic link with this command:
After that, I thought bc of some reasons the Git Bash is not counted as a profile. So I tried to create a new profile by pressing ctrl+shift+p then terminal: select default profile then I pressed configure button of Powershell. And after that when I try to type Git Bash they said I already have a profile with Git Bash name.
this finally worked for me
"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": {
"path": ["C:\\Program Files\\Git\\bin\\bash.exe"],
"args": [],
"icon": "terminal-bash"
}
},
"terminal.integrated.defaultProfile.windows": "GitBash"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With