步骤说明

1. 确认 Git Bash 路径

因为我自定义了 scoop 的安装路径,目前 Git Bash的路径是

D:\scoop\apps\git\current\bin\bash.exe

(请根据你的 Scoop 实际安装路径调整)

2. 修改 Cursor 配置

  1. 打开 Cursor 设置(Settings)
  2. 找到并打开 settings.json 文件
  3. 添加或修改以下配置:
{
    "terminal.integrated.defaultProfile.windows": "Git Bash",
    "terminal.integrated.profiles.windows": {
        "Git Bash": {
            "source": "Git Bash",
            "path": "D:\\scoop\\apps\\git\\current\\bin\\bash.exe",
            "args": []
        }
    }
}

3. 完成设置

  1. 保存 settings.json 文件
  2. 重启 Cursor
  3. 新打开的终端将默认使用 Git Bash

注意事项

  • 请确保路径中使用双反斜杠 \\
  • 路径要匹配你的 Scoop 实际安装位置
  • 配置文件必须是有效的 JSON 格式