使用VSCode在集成终端中运行任务?

问题描述 投票:3回答:1

过去运行任务(tasks.json)时,它们在VSCode中的Integrated Terminal中运行。但是,在重置开发机器并重新安装所有内容之后,我的任务现在在新的cmd窗口中运行。当任务失败并出现错误时,这是​​一个问题。在这种情况下,cmd窗口只是关闭,我看不到实际错误是什么。

我如何让任务再次在集成终端中运行?

visual-studio-code task
1个回答
0
投票

ITNOA

如果您在版本2中使用task.json,则>

您只需要在presentation中写入tasks属性,如下所示:

        "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 help

© www.soinside.com 2019 - 2024. All rights reserved.