將以下配置添加到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": {
"path": "D:\\Program Files\\Git\\bin\\bash.exe",
"args": [],
"icon": "terminal-bash"
}
},
"terminal.integrated.defaultProfile.windows": "Git-Bash",
-
terminal.integrated.profiles.windows
這個(gè)配置項(xiàng)是就是添加終端的 -
terminal.integrated.defaultProfile.windows
這個(gè)是配置默認(rèn)選項(xiàng)的
配置時(shí)的兩個(gè)注意點(diǎn):文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-528512.html
- git bash終端的名字得是‘
Git-Bash
’,不能是“Git Bash
”,否則vscode檢測(cè)不到 - path是git執(zhí)行路徑,path和source不能共存!如果有source,就不要用path
source是git的默認(rèn)安裝路徑,如果 Git 不是安裝在默認(rèn)路徑,則需要把"source":“Git Bash"替換為"path”: Git的安裝路徑\bin\bash.exe 。注意,不是 git-bash.exe 的路徑,是 bash.exe 的路徑!
這樣就可以啦如圖:文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-528512.html
到了這里,關(guān)于在vscode中配置git bash終端的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!