在 VSCode 的集成终端中运行任务? [英] Run tasks in Integrated Terminal in VSCode?
问题描述
我过去运行任务 (tasks.json) 时,它们在 VSCode 的集成终端内运行.但是,在重置我的开发机器并重新安装所有内容后,我的任务现在在新的 cmd 窗口中运行.当任务失败并出现错误时,这是一个问题.在这种情况下,cmd 窗口刚刚关闭,我无法读取实际错误是什么.
when I ran tasks (tasks.json) in the past, they ran inside the Integrated Terminal in VSCode. However, after resetting my dev machine and reinstalling everything, my tasks now run in a new cmd window. This is a problem when the task fails with an error. In this case, the cmd window is just closed and I can't read what the actual error is.
如何让任务再次在集成终端中运行?
How do I get the tasks to run in the Integrated Terminal again?
推荐答案
ITNOA
如果您使用的是 task.json 版本 2
If you are using task.json with version 2
您只需要在 tasks
中编写 presentation
属性,如下所示:
you just need write presentation
property in tasks
like below:
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": false
}
完整示例如下
"tasks": [
{
"label": "example",
"type": "shell",
"command": "foo",
"args": [],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": false
}
}
]
有关更多信息,您可以阅读 vscode task.json 帮助
for more information you can read vscode task.json help
这篇关于在 VSCode 的集成终端中运行任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!