【发布时间】:2021-09-18 18:34:43
【问题描述】:
我尝试将 Git Bash 设置为 VSCode 中的默认终端,但无法成功。我已尝试关注下一篇文章:
- How do I use Bash on Windows from the Visual Studio Code integrated terminal?
- How to Add Git Bash to VsCode
但他们还没有解决我的问题。
我设法在settings.json 中生成了配置文件,但由于我不知道的某种原因,Git Bash 无法工作,并且 VsCode 显示错误。
我的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"
}
错误:
有谁知道如何解决这个问题?
我的 VsCode 版本:
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
编辑:
我使用git SDK,它类似于 git-bash,但不完全一样。也许这就是问题所在?
【问题讨论】:
-
在进行这些更改后尝试完全重新启动 VS Code。我在previous answer 中发现我需要这样做才能让 VS Code 获取新添加的配置文件。
-
@TimothyG。在我的情况下,VsCode 重启没有帮助。
标签: windows visual-studio-code windows-10 vscode-settings git-bash