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

如何在VS Code中使用Windows Terminal作为调试控制台?

用Windows Terminal作为VS Code Python调试控制台的设置方法

步骤1:修改launch.json配置

打开项目的.vscode/launch.json文件,把配置里的"console": "integratedTerminal"替换为"console": "externalTerminal",修改后的完整配置如下:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File External Terminal",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "externalTerminal",
            "justMyCode": true
        }
    ]
}

步骤2:设置Windows Terminal为VS Code默认外部终端

  • 按下Ctrl+,打开VS Code设置界面
  • 在搜索栏输入terminal.external.windowsExec
  • 将对应的值设置为Windows Terminal的可执行文件路径,常规路径为:
    C:\Users\<你的用户名>\AppData\Local\Microsoft\WindowsApps\wt.exe
    
    把<你的用户名>替换成你实际的Windows用户名即可
  • 可选:如果想让调试时在Windows Terminal的新标签页打开,可搜索terminal.external.windowsArgs,设置值为["-w", "new"]

完成以上设置后,启动Python调试时就会自动调用Windows Terminal作为控制台,替代VS Code的集成终端。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.02 13:40:35