简体   繁体   English

在终端上运行文件时如何在 Visual Studio Code 中自动清除终端?

[英]How to automatically clear terminal in Visual Studio Code when running the file on terminal?

is there a way to configure VS Code to automatically clear the terminal right before I run a Python file, for example?例如,有没有办法配置 VS Code 在我运行 Python 文件之前自动清除终端? I searched a lot for that but without success.我为此搜索了很多,但没有成功。 Whenever I try to run a file in terminal, previous runs are still there in the terminal, and it gets kinda confusing.每当我尝试在终端中运行文件时,以前的运行仍然存在于终端中,这有点令人困惑。 Notice that I want to clear the terminal when I run the code in terminal (ie when I click the play button), not when I run with debugging.请注意,我想在终端中运行代码时(即单击播放按钮时)清除终端,而不是在运行调试时清除终端。 My idea is to always have the terminal empty when I run a file.我的想法是在运行文件时始终让终端为空。 Any thoughts?有什么想法吗?

Currently in VS Code, it does not automatically clear the terminal data settings, but you could use the command " clear " in the VS Code terminal to clear the previous output data, or click the'kill' icon to delete the current terminal and use the shortcut key Ctrl+Shift+` to open a new VS Code terminal.目前在VS Code中,不会自动清除终端数据设置,但是可以在VS Code终端中使用命令“ clear ”清除之前的output数据,或者点击‘kill’图标删除当前终端并使用快捷键 Ctrl+Shift+` 打开一个新的 VS Code 终端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM