Change:
// Revive processes if needed const serializedState = this._storageService.get(TerminalStorageKeys.TerminalBufferState, StorageScope.WORKSPACE); <del> const parsed = this._deserializeTerminalState(serializedState); if (!parsed) { return undefined; } try { // Note that remote terminals do not get their environment re-resolved unlike in local terminals mark('code/terminal/willReviveTerminalProcessesRemote'); await this._remoteTerminalChannel.reviveTerminalProcesses(parsed, Intl.DateTimeFormat().resolvedOptions().locale); mark('code/terminal/didReviveTerminalProcessesRemote'); this._storageService.remove(TerminalStorageKeys.TerminalBufferState, StorageScope.WORKSPACE); // If reviving processes, send the terminal layout info back to the pty host as it // will not have been persisted on application exit const layoutInfo = this._storageService.get(TerminalStorageKeys.TerminalLayoutInfo, StorageScope.WORKSPACE); if (layoutInfo) { mark('code/terminal/willSetTerminalLayoutInfoRemote'); await this._remoteTerminalChannel.setTerminalLayoutInfo(JSON.parse(layoutInfo)); mark('code/terminal/didSetTerminalLayoutInfoRemote'); this._storageService.remove(TerminalStorageKeys.TerminalLayoutInfo, StorageScope.WORKSPACE); </del> <ins> const reviveBufferState = this._deserializeTerminalState(serializedState); if (reviveBufferState && reviveBufferState.length > 0) { try { // Note that remote terminals do not get their environment re-resolved unlike in local terminals mark('code/terminal/willReviveTerminalProcessesRemote'); await this._remoteTerminalChannel.reviveTerminalProcesses(reviveBufferState, Intl.DateTimeFormat().resolvedOptions().locale); mark('code/terminal/didReviveTerminalProcessesRemote'); this._storageService.remove(TerminalStorageKeys.TerminalBufferState, StorageScope.WORKSPACE); // If reviving processes, send the terminal layout info back to the pty host as it // will not have been persisted on application exit const layoutInfo = this._storageService.get(TerminalStorageKeys.TerminalLayoutInfo, StorageScope.WORKSPACE); if (layoutInfo) { mark('code/terminal/willSetTerminalLayoutInfoRemote'); await this._remoteTerminalChannel.setTerminalLayoutInfo(JSON.parse(layoutInfo)); mark('code/terminal/didSetTerminalLayoutInfoRemote'); this._storageService.remove(TerminalStorageKeys.TerminalLayoutInfo, StorageScope.WORKSPACE); } } catch (e: unknown) { this._logService.warn('RemoteTerminalBackend#getTerminalLayoutInfo Error', e && typeof e === 'object' && 'message' in e ? e.message : e); </ins> } <del> } catch (e: unknown) { this._logService.warn('RemoteTerminalBackend#getTerminalLayoutInfo Error', e && typeof e === 'object' && 'message' in e ? e.message : e); </del> } return this._remoteTerminalChannel.getTerminalLayoutInfo();

Discussion:
some terminals and type in them the window or restart VS Code they don't persist Started happening in OSS on Wednesday July 5th
is undefined !
it gets set to !
that's the return value (see )
yes, true. but the call returns so it's getting reset somewhere. not via !
I'm on to the cause... The process is getting killed after detaching on reload, so reconnect breaks: Revive after restart is working for me.
Ah found it: Investigating...
Parsed state is null so reconnect stops here: