【发布时间】:2020-11-05 05:10:47
【问题描述】:
我正在使用 Mac OS X 的 VS Code。有没有一种方法可以让 VS Code 在我每次运行时自动清除显示 Python 程序输出的终端窗口?我想在执行前清除终端窗口。
编辑:查看建议的链接,我想通过 VS Code 任务来执行此操作。我看到我需要编辑.vscode目录中的tasks.json文件,但是每次运行Python文件之前我如何触发任务,我还要为任务填写哪些其他参数?
这里还是有点糊涂。我为"command" 和"label" 输入什么?
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "echo Hello",
"clear": "true"
}
]
}
【问题讨论】:
-
这能回答你的问题吗? How to clear the interpreter console?
标签: python macos visual-studio-code