How can i listen running task's progress?

I am using taskService.runTask method to run custom shell tasks. But it seems like using await doesn’t actually wait for task to finish, instead it resolves as soon as the process has started. How do i handle the tasks’ progress. (i.e. i want to show loaders, disable some actions etc.)

await this.taskService.runTask(task);
console.log("task finished running");

There is some prior art in the DebugSessionManager that may be of inspiration. See the runTask function.