Answer a question

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.

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.

Help is greatly appreciated.

Thanks in advance
-Simon

Answers

There is a new setting due in v1.55:

debug.terminal.clearBeforeReusing

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.

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.

from https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_55.md#new-setting-for-clearing-a-terminal-before-launching-a-debuggee

Logo

开发云社区提供前沿行业资讯和优质的学习知识,同时提供优质稳定、价格优惠的云主机、数据库、网络、云储存等云服务产品

更多推荐