src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts/TerminalTaskSystem/_reconnectToTerminals
class TerminalTaskSystem:	private _reconnectToTerminals(): void {
		if (this._hasReconnected) {
			this._logService.trace(`Already reconnected, to ${this._reconnectedTerminals?.length} terminals so returning`);
			return;
		}
		this._reconnectedTerminals = this._terminalService.getReconnectedTerminals(ReconnectionType)?.filter(t => !t.isDisposed);
		this._logService.trace(`Attempting reconnection of ${this._reconnectedTerminals?.length} terminals`);
		if (!this._reconnectedTerminals?.length) {
			this._logService.trace(`No terminals to reconnect to so returning`);
		} else {
			for (const terminal of this._reconnectedTerminals) {
				const task = terminal.shellLaunchConfig.attachPersistentProcess?.reconnectionProperties?.data as IReconnectionTaskData;
				this._logService.trace(`Reconnecting to task: ${JSON.stringify(task)}`);
				if (!task) {
					continue;
				}
				const terminalData = { lastTask: task.lastTask, group: task.group, terminal };
				this._terminals[terminal.instanceId] = terminalData;
			}
		}
		this._hasReconnected = true;
	}