Custom task output

Hi all
I have customized some tasks(not shell or process), I don’t know how to display the output of the task on the terminal. Is there any examples?

Thanks for your help

You’ll have to give us some more info here: what do you mean by “customized tasks”? Did you register a task provider via the VS Code API?

yes, I registered a task by myself. the task will exec some script which return a promise

contribution

export class CustomTaskRunnerContribution implements TaskRunnerContribution {

@inject(JumpTaskRunner)
protected readonly customTaskRunner: JumpTaskRunner;

registerRunner(runners: TaskRunnerRegistry): void {
    runners.registerRunner('CustomExecution', this.customTaskRunner);
}
}

custom-task

export class CustomTask extends Task {

constructor() {

someThingPromise.then(res => {
    this.fireTaskExited({ taskId: this.id, code: 0 })
    // show text in terminal
    showInfo(text)
}).catch(e => {
   this.fireTaskExited({ taskId: this.id, code: 1 })
})

  }

I guess the key is to do the same things the other TaskRunner implementations are doing. Probably start some processes, hook them up to terminals and the likes. Unfortunately, I’m not an expert in that part of town.