【问题标题】:Run tasks in Integrated Terminal in VSCode?在 VSCode 的集成终端中运行任务?
【发布时间】:2019-02-05 09:31:48
【问题描述】:

当我过去运行任务 (tasks.json) 时,它们在 VSCode 的集成终端中运行。但是,在重置我的开发机器并重新安装所有内容后,我的任务现在在新的 cmd 窗口中运行。当任务因错误而失败时,这是一个问题。在这种情况下,cmd 窗口刚刚关闭,我无法读取实际错误。

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

【问题讨论】:

    标签: visual-studio-code task


    【解决方案1】:

    ITNOA

    如果您使用的是版本 2 的 task.json

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

            "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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-08-22
      • 1970-01-01
      • 2019-02-23
      • 2019-06-12
      • 2021-11-04
      相关资源
      最近更新 更多