I'm trying to run a long-lived background task in visual studio (tsc --watch
) while also running my app as two separate tasks. So, (app)-[dependsOn]->(tsc --watch)
. But, it appears that the app
task waits for the tsc
command to finish before it executes, which is a problem since it runs forever.
I'm simplifying my problem to show the actual issue I'm running into, but should hopefully guide me down the right path.
I have two task in my tasks.json file:
{
"label": "Echo 1",
"command": "echo",
"type": "shell",
"args": [
"echo1"
],
"group": {
"isDefault": true,
"kind": "build"
},
"dependsOrder": "parallel",
"dependsOn": [
"Sleep 5"
]
},
{
"label": "Sleep 5",
"type": "shell",
"command": "sleep",
"isBackground": true,
"args": [
"5"
]
}
Echo 1 -depends on-> Sleep 5
According to visual studio documentation the sleep task should be running in the background allowing the Echo task to do it's thing. But, whenever I execute the Echo 1
task, it waits until Sleep 5
is finished and THEN it actually executes the echo task.
> Executing task: sleep 5 <
Terminal will be reused by tasks, press any key to close it.
> Executing task: echo echo1 <
echo1
Terminal will be reused by tasks, press any key to close it.
I've tried adding the background
property detailed in the documentation, but the editor shows a popup with the message Property background is not allowed.
whenever I add that field.
Am I missing something else to ensure that the Sleep 5
task doesn't block the Echo 1
task?
I've tried already tried using the presentation
with panel: dedicated/new
to each task so they don't use the same terminal (not even sure if that's how visual studio executes it's tasks).