src/vs/workbench/contrib/terminal/browser/terminalService.ts/TerminalService/_onWillShutdown
class TerminalService:	private _onWillShutdown(e: WillShutdownEvent): void {
		// Don't touch processes if the shutdown was a result of reload as they will be reattached
		const shouldPersistTerminals = this._configHelper.config.enablePersistentSessions && e.reason === ShutdownReason.RELOAD;
		if (shouldPersistTerminals) {
			for (const instance of this.instances) {
				instance.detachProcessAndDispose(TerminalExitReason.Shutdown);
			}
			return;
		}

		// Force dispose of all terminal instances
		const shouldPersistTerminalsForEvent = this._shouldReviveProcesses(e.reason);
		for (const instance of this.instances) {
			if (shouldPersistTerminalsForEvent) {
				instance.shutdownPersistentProcessId = instance.persistentProcessId;
			}
			instance.dispose(TerminalExitReason.Shutdown);
		}

		// Clear terminal layout info only when not persisting
		if (!this._shouldReviveProcesses(e.reason)) {
			this._primaryBackend?.setTerminalLayoutInfo(undefined);
		}
	}