如何解决尝试将 Git Bash 设置为终端的默认配置文件时,设置中出现 VSCode 错误
我尝试将 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 但不完全是。也许这就是问题所在?
解决方法
这终于对我有用
"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"],"icon": "terminal-bash"
}
},"terminal.integrated.defaultProfile.windows": "GitBash"
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。