每次构建/运行时,VS Code 都会打开一个新的调试控制台 [英] VS Code opens a new debug console every time I build/run

查看:56
本文介绍了每次构建/运行时,VS Code 都会打开一个新的调试控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我在 VSCode 中构建或运行程序时,都会加载一个新的 Python 调试控制台.在我知道之前,我有 20 多个,需要开始删除它们.在打开 32 个控制台后,我收到错误终端进程以退出代码终止:256".我最近将终端从默认控制台更改为 git bash.我怎么能阻止这个?

Every time I build or run a program in VSCode a new python debug console is loaded. Before I know it I have 20+ and need to start deleting them. After 32 open consoles I get the error "The terminal process terminated with exit code: 256". I changed the terminal from the default console to git bash recently. How can I stop this?

推荐答案

解决此问题的方法是首先在调试期间阻止 VS Code 冗余打印到 TERMINAL.由于它也打印到​​ DEBUG CONSOLE,您可以改用它.

A way around this issue is to stop VS Code from redundantly printing to the TERMINAL during debugging in the first place. Since it prints to the DEBUG CONSOLE as well, you can use that instead.

在项目启动的每个配置中将console更改为"none" "internalConsole".json 文件:

Change console to "none" "internalConsole" in each configuration in your project's launch.json file:

"configurations": [
    {
        "name": "Python: Current File",
        "type": "python",
        "request": "launch",
        "program": "${file}",
        "console": "internalConsole"
    }
]

2019 年 5 月更新:"none" 选项被 "internalConsole" 替换,所以我编辑了我的答案以反映这一点.这是相关的 GitHub 问题.

May 2019 Update: the "none" option was replaced by "internalConsole" so I edited my answer to reflect that. Here's the relevant GitHub Issue.

这篇关于每次构建/运行时,VS Code 都会打开一个新的调试控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆