Repository: vscode
Issue: `onDidStartTask()` does not fire when task is run via `executeTask()`...
Labels: bug,tasks

Hi there :wave:

I ran into a weird issue - my `vscode.tasks.onDidStartTask()` hook ([docs](https://code.visualstudio.com/api/references/vscode-api#tasks.onDidStartTask)) will not fire when i run my task using the `vscode.tasks.executeTask()` method ([docs](https://code.visualstudio.com/api/references/vscode-api#tasks.executeTask)). It works as expected when the task is run via the "Terminal" > "Run Task..." menu item 🤔 🤷‍♂️ 

Steps to Reproduce:

1. Wire up an `onDidStartTask()` event listener ([docs](https://code.visualstudio.com/api/references/vscode-api#tasks.onDidStartTask)) - e.g.

```js
const vscode = require('vscode');

module.exports.activate = async (context) => {
    vscode.tasks.onDidStartTask((event) => {
        console.log(`Task started ${event.execution.task.name}`);
    });
}
```

2. Trigger a task via `executeTask()` ([docs](https://code.visualstudio.com/api/references/vscode-api#tasks.executeTask)) - e.g.

```js
vscode.tasks.executeTask(myTask);
```

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->

VS Code version: Code 1.58.0 (2d23c42a936db1c7b3b06f918cde29561cc47cd6, 2021-07-08T06:54:17.694Z)
OS version: Darwin x64 20.5.0
Restricted Mode: No

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz (6 x 3700)|
|GPU Status|2d_canvas: enabled<br>gpu_compositing: enabled<br>metal: disabled_off<br>multiple_raster_threads: enabled_on<br>oop_rasterization: enabled<br>opengl: enabled_on<br>rasterization: enabled<br>skia_renderer: disabled_off_ok<br>video_decode: enabled<br>webgl: enabled<br>webgl2: enabled|
|Load (avg)|3, 2, 2|
|Memory (System)|32.00GB (0.08GB free)|
|Process Argv|--folder-uri file:///Users/me/code/particle/workbench/packages/particle-vscode-core --crash-reporter-id aa188d99-b16d-405c-92e2-b6b56b6bbf95|
|Screen Reader|no|
|VM|0%|
</details>

Extensions: none

<details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vsreu685:30147344
python383:30185418
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt639:30300192
pythontb:30283811
pythonvspyt551cf:30311713
vspre833:30321513
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscorecescf:30322572
pythondataviewer:30285071
vscus158:30321503
pythonvsuse255:30335481
vscorehov:30309549
vscod805:30301674
pythonvspyt200:30331937
vscextlang:30333561
binariesv615:30325510
vsccppwt:30329788
vstea450:30335276
bridge0708:30335490

```

</details>

<!-- generated by issue reporter -->