src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts/TerminalTaskSystem/_reconnectToTerminal
class TerminalTaskSystem:	private async _reconnectToTerminal(task: Task): Promise<ITerminalInstance | undefined> {
		if (!this._reconnectedTerminals) {
			return;
		}
		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.getCommonTaskId()) {
				this._reconnectedTerminals.splice(i, 1);
				return terminal;
			}
		}
		return undefined;
	}