1 在
Windows
系统下,VS Code
默认的终端为powershell
,不支持wc -l
等bash命令。
2 安装Git Bash
。
3 可自由选择使用powershell
或者Git Bash
。
1 为VS Code配置git bash
1.1 安装git
默认安装的情况下,bash.exe
的路径为C:\Program Files\Git\bin\
。
1.2 配置VS Code的setting.json
打开setting.json
,并添加如下命令,用于强制制定集成终端的shell
:
"terminal.integrated.profiles.windows": {
"Git Bash": { //自定义名称
"path": "C:\\Program Files\\Git\\bin\\bash.exe", //路径
"args": [],
"icon": "terminal-bash" //该终端的图标
}
},
"terminal.integrated.defaultProfile.windows": "Git Bash", //设置Git Bash为默认终端
1.3 重启窗口
重启VS Code
后,其终端便为Git Bash
了。