diff --git a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts index 0499c4cd0b599..22c53792466fd 100644 --- a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts +++ b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts @@ -882,6 +882,7 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem { watchingProblemMatcher.aboutToStart(); let delayer: Async.Delayer | undefined = undefined; [terminal, error] = this._terminalForTask ? [this._terminalForTask, undefined] : await this._createTerminal(task, resolver, workspaceFolder); + this._terminalForTask = undefined; if (error) { return Promise.reject(new Error((error).message)); @@ -964,6 +965,7 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem { }); } else { [terminal, error] = this._terminalForTask ? [this._terminalForTask, undefined] : await this._createTerminal(task, resolver, workspaceFolder); + this._terminalForTask = undefined; if (error) { return Promise.reject(new Error((error).message));