From 35b971c92d210face8c446a1c6f1e470ad2bcb54 Mon Sep 17 00:00:00 2001 From: Megan Rogge Date: Thu, 25 Aug 2022 18:28:24 -0700 Subject: [PATCH] use common task ID instead of map key (#159233) * fix #158886 * Update src/vs/workbench/contrib/terminal/test/browser/links/terminalLocalLinkDetector.test.ts --- src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts index 6e140095a5913..16c3a44a71e88 100644 --- a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts +++ b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts @@ -1287,7 +1287,7 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem { for (let i = 0; i < this._reconnectedTerminals.length; i++) { const terminal = this._reconnectedTerminals[i]; const taskForTerminal = terminal.shellLaunchConfig.attachPersistentProcess?.reconnectionProperties?.data as IReconnectionTaskData; - if (taskForTerminal.lastTask === task.getMapKey()) { + if (taskForTerminal.lastTask === task.getCommonTaskId()) { this._reconnectedTerminals.splice(i, 1); return terminal; } @@ -1455,7 +1455,7 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem { this._terminalCreationQueue = this._terminalCreationQueue.then(() => this._doCreateTerminal(task, group, launchConfigs!)); const terminal: ITerminalInstance = (await this._terminalCreationQueue)!; - terminal.shellLaunchConfig.reconnectionProperties = { ownerId: ReconnectionType, data: { lastTask: taskKey, group, label: task._label, id: task._id } }; + terminal.shellLaunchConfig.reconnectionProperties = { ownerId: ReconnectionType, data: { lastTask: task.getCommonTaskId(), group, label: task._label, id: task._id } }; const terminalKey = terminal.instanceId.toString(); const terminalData = { terminal: terminal, lastTask: taskKey, group }; terminal.onDisposed(() => this._deleteTaskAndTerminal(terminal, terminalData));