Change:
From Run the command Enter: In the eventual modal dialog, press Expecting a window reload, but there is an error instead. You can also call the command I debugged it down to veto from terminal. Exception thrown while serializing the terminal: The veto hander should handle all exceptions and return false, unless it really wants to veto the window close.
Closing for verification as it looks like this has been merged into release/1.62
Remote connection is going in a restarting loop. Restart remote connection is the only thing that we are getting now. Not possible to work at all with vscode.

Discussion:
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; import { ACTIVE_GROUP, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; <ins> import { ILogService } from 'vs/platform/log/common/log'; </ins> export class TerminalService implements ITerminalService { declare _serviceBrand: undefined;

@IContextKeyService private _contextKeyService: IContextKeyService, @ILabelService labelService: ILabelService, @ILifecycleService lifecycleService: ILifecycleService, <ins> @ILogService private readonly _logService: ILogService, </ins> @IDialogService private _dialogService: IDialogService, @IInstantiationService private _instantiationService: IInstantiationService, @IRemoteAgentService private _remoteAgentService: IRemoteAgentService,

// Persist terminal _buffer state_, note that even if this happens the dirty terminal prompt // still shows as that cannot be revived <del> this._shutdownWindowCount = await this._nativeDelegate?.getWindowCount(); const shouldReviveProcesses = this._shouldReviveProcesses(reason); if (shouldReviveProcesses) { await this._primaryOffProcessTerminalService?.persistTerminalState(); } // Persist terminal _processes_ const shouldPersistProcesses = this._configHelper.config.enablePersistentSessions && reason === ShutdownReason.RELOAD; if (!shouldPersistProcesses) { const hasDirtyInstances = ( (this.configHelper.config.confirmOnExit === 'always' && this.instances.length > 0) || (this.configHelper.config.confirmOnExit === 'hasChildProcesses' && this.instances.some(e => e.hasChildProcesses)) ); if (hasDirtyInstances) { return this._onBeforeShutdownConfirmation(reason); </del> <ins> try { this._shutdownWindowCount = await this._nativeDelegate?.getWindowCount(); const shouldReviveProcesses = this._shouldReviveProcesses(reason); if (shouldReviveProcesses) { await this._primaryOffProcessTerminalService?.persistTerminalState(); } // Persist terminal _processes_ const shouldPersistProcesses = this._configHelper.config.enablePersistentSessions && reason === ShutdownReason.RELOAD; if (!shouldPersistProcesses) { const hasDirtyInstances = ( (this.configHelper.config.confirmOnExit === 'always' && this.instances.length > 0) || (this.configHelper.config.confirmOnExit === 'hasChildProcesses' && this.instances.some(e => e.hasChildProcesses)) ); if (hasDirtyInstances) { return this._onBeforeShutdownConfirmation(reason); } </ins> } <ins> } catch (err: unknown) { // Swallow as exceptions should not cause a veto to prevent shutdown this._logService.warn('Exception occurred during terminal shutdown', err); </ins> } this._isShuttingDown = true;