You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何永久设置Visual Studio Code默认启动终端

VS Code启动默认加载Bash设置方法
  • 打开VS Code设置界面:按下快捷键Ctrl+,(Windows/Linux)或Cmd+,(Mac)快速唤起
  • 顶部搜索框输入对应系统的默认终端配置项:
    • Windows系统输入terminal.integrated.defaultProfile.windows
    • Mac系统输入terminal.integrated.defaultProfile.osx
    • Linux系统输入terminal.integrated.defaultProfile.linux
  • 在「终端 > 集成 > 默认配置文件」的下拉选项中选中Bash作为默认值
  • 若修改后启动还是加载PowerShell,大概率是终端会话持久化导致的:搜索terminal.integrated.persistSession,取消勾选该选项,关闭VS Code恢复上次终端会话的特性
  • 如上述操作仍无效,可以手动编辑JSON配置文件:按下Ctrl+Shift+P(Windows/Linux)或Cmd+Shift+P(Mac)唤起命令面板,输入「首选项:打开设置(JSON)」,添加对应配置:
    示例(Windows Git Bash):
    "terminal.integrated.defaultProfile.windows": "Git Bash",
    "terminal.integrated.profiles.windows": {
      "Git Bash": {
        "path": "C:\\Program Files\\Git\\bin\\bash.exe",
        "args": []
      }
    }
    
    请将path值替换为你设备上Bash执行文件的实际存储路径
  • 保存配置后重启VS Code即可生效

内容的提问来源于stack exchange,提问作者Reis

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.05 05:27:02