VSCode:调试开始时清除集成终端 [英] VSCode: clear integrated terminal when debug starts

查看:46
本文介绍了VSCode:调试开始时清除集成终端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 launch.json 中使用 "console": "integratedTerminal" 时,程序输出被重定向到集成终端.但是,在终止调试会话并启动另一个调试会话后,终端会被重新使用,这可能非常烦人.

when using "console": "integratedTerminal" in a launch.json the program output is redirected to the integrated terminal. However, after terminating a debug session and starting another one, the terminal is re-used which can be pretty annoying.

我还没有找到让 VSCode 清除终端的方法——可以 使用 clear: true 属性清除 tasks.json 中的面板,但这仅适用于构建任务等任务,但对调试面板没有影响.

I have not found a way to make VSCode clear the terminal -- it is possible to clear the panel in tasks.json with the clear: true property, this however only works for tasks such as the build task but has no effect on the debug panel.

非常感谢您的帮助.

提前致谢
-西蒙

Thanks in advance
-Simon

推荐答案

v1.55 中有一个新设置:

There is a new setting due in v1.55:

debug.terminal.clearBeforeReusing

一些调试扩展允许在 VS Code 的集成中启动调试器终端.为了保持集成终端的数量较少,VS如果终端没有被仍在运行的程序阻塞,代码会尝试重用它命令.这种方法的结果是以前的命令和程序输出将在终端中保持可见,有时令人困惑.

Some debug extension allow to launch debuggees in VS Code's integrated terminal. In order keep the number of integrated terminals small, VS Code tries to reuse a terminal if it is not blocked by a still running command. A consequence of this approach is that previous commands and program output will remain visible in the terminal which is sometimes confusing.

在此版本中,我们引入了一项新功能来自动清除开始新的调试会话之前的集成终端.这功能由新设置控制debug.terminal.clearBeforeReusing.

In this release we've introduced a new feature to automatically clear the integrated terminal before starting a new debug session. The feature is controlled by the new setting debug.terminal.clearBeforeReusing.

来自 https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_55.md#new-setting-for-clearing-a-terminal-在启动调试对象之前

这篇关于VSCode:调试开始时清除集成终端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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