Check if the new feature from VSCode 1.57 (May 2021, 2.5 years after the OP) could help:
Automatically close task terminals
The task
presentation
property has a newclose
property.
Settingclose
totrue
will cause the terminal to close when the task exits.{ "type": "shell", "command": "node build/lib/preLaunch.js", "label": "Ensure Prelaunch Dependencies", "presentation": { "reveal": "silent", "revealProblems": "onProblem", "close": true } }
[EDIT: 18-08-2018] Making it switch into the Problems tab is better when using the close option as that ensures the task terminal is closed, but the problems are properly highlighted. This is from VSCode 1.59.0.
Danin adds in the comments:
After fiddling around, I found an easy way to do it in-app;
Terminal > Configure Tasks >
(select your desired task)>
add"presentation": { .. }
block to level containing matching"task:"
entry.
Danin also mentions:
I also omitted the
"reveal"
entry because I prefer to see the terminal briefly — it just interferes with workflows to have it stick around.