Repository: vscode
Issue:  errors in dependsOn background tasks do not prevent subsequent tasks from executing
Labels: feature-request,tasks

<!-- Please search existing issues to avoid creating duplicates. -->
<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: https://code.visualstudio.com/insiders/ -->

<!-- Use Help > Report Issue to prefill these. -->
- VSCode Version: 1.32.1
- OS Version: 18309

Steps to Reproduce:

create launch.json:
```
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [        
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceFolder}\\src\\FrontEnd\\build",
            "preLaunchTask": "core"
        }
    ]
}
```
2. create task.json:
```
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558 
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "core",            
            "type": "npm",
            "script": "start",
            "path": "src/FrontEnd/core/",
            "isBackground": true,
            "dependsOn":["loss"],
            "problemMatcher":{
                "owner": "custom",
                "pattern":[
                    {
                        "regexp": "something not exists",
                        "file": 1,
                        "location": 2,
                        "message": 3
                    }
                ],
                "background": {
                    "activeOnStart": true,
                    "beginsPattern": "core@1.0.0 start",
                    "endsPattern": "created ..\\\\build\\\\vendor.js"
                }
            }
        },
        {
            "label": "loss",            
            "type": "npm",
            "script": "watch",
            "path": "src/FrontEnd/loss/",
            "isBackground": true,            
            "problemMatcher":{
                "owner": "custom",
                "pattern":[
                    {
                        "regexp": "something not exists",
                        "file": 1,
                        "location": 2,
                        "message": 3
                    }
                ],
                "background": {
                    "activeOnStart": true,
                    "beginsPattern": "loss@1.0.0 start",
                    "endsPattern": "waiting for changes"
                }
            }
        }
    ]
}
```

I can use beginsPattern/endsPattern with no issue if I direct launched by preLaunchTask, but if I have DependsOn for same task, it will run the dependencies but can't detect it's status by using endsPattern, the task will hang there. it looks like a bug for me. 

I tried to use the new Terminal: "terminal.integrated.windowsEnableConpty": false/true, no difference. 
I tried to use presentation.panel:"dedicated", no difference. 

I think we have done a nice work on putting tasks running in background and launch, but not those tasks in DependsOn property. 



<!-- Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes