Run tasks in Integrated Terminal in VSCode?

回眸只為那壹抹淺笑 提交于 2020-05-29 07:31:59

问题


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?


回答1:


ITNOA

If you are using task.json with version 2

you just need write presentation property in tasks like below:

        "presentation": {
            "echo": true,
            "reveal": "always",
            "focus": true,
            "panel": "shared",
            "showReuseMessage": true,
            "clear": false
        }

full example like below

"tasks": [
    {
        "label": "example",
        "type": "shell",
        "command": "foo",
        "args": [],
        "presentation": {
            "echo": true,
            "reveal": "always",
            "focus": true,
            "panel": "shared",
            "showReuseMessage": true,
            "clear": false
        }
    }
]

for more information you can read vscode task.json help



来源:https://stackoverflow.com/questions/52097000/run-tasks-in-integrated-terminal-in-vscode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!