前言

VScode 的终端中没有包含 Git Bash,但预留了它的位置。本文将演示如何在设置中添加 Git Bash 终端。

本文适用于 VScode 1.71.0 版本及其它较新版本

操作步骤

  1. 文件 -> 首选项 -> 设置,打开设置
  2. 搜索 shell windows
1
  1. 打开 settings.json 在里面输入代码如下:
image-20220904170153395

注意两点:

  • settings.json 中原先为 "Git Bash",需要删除空格,例如改为 "GitBash"
  • 删除 "GitBash" 中的 "Source",只保留 "path"
  1. 保存重启 vscode,按 ctrl+~ 键打开终端,完成
image-20220904170717210