type
status
date
slug
summary
tags
category
icon
password
今天打开 VSCode 准备撸代码,打开终端,结果发现原来配置的 bash 不能用了,只有 PowerShell 和 Command Prompt。这让人很不舒适,于是网上搜罗了一番了,可惜都是些陈芝麻烂谷子,没一个能用的。
原来我们是用的 "terminal.integrated.shell.windows" 来配置终端的,但是在 2021 年 4 月已经弃用了这个字段,现在要用最新的 "terminal.integrated.profiles.windows" 来配置,配置如下:
详细步骤:
- 打开“设置”
- 在搜索框中搜索:terminal.integrated.profiles.windows
- 点击下方:在 settings.json 中编辑,进入到 settings.json 文件
"terminal.integrated.defaultProfile.windows": "GitBash"
这一条设置后,就会在打开终端后,默认使用 bash 作为终端了;- Git Bash 的路径请填你自己电脑上 bash.exe 的位置。
之后将终端配置写进去,之后请看第 4 步。
注意:
- 最后,务必重启 VSCode 编辑器,然后打开终端重试即可。
- 作者:Eric 见嘉
- 链接:https://tangly1024.com/article/how-to-set-git-bash
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。
相关文章