问题
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