src/vs/platform/terminal/node/ptyService.ts/PersistentTerminalProcess/detach
class PersistentTerminalProcess:	async detach(forcePersist?: boolean): Promise<void> {
		this._logService.trace('persistentTerminalProcess#detach', this._persistentProcessId, forcePersist);
		// Keep the process around if it was indicated to persist and it has had some iteraction or
		// was replayed
		if (this.shouldPersistTerminal && (this._interactionState.value !== InteractionState.None || forcePersist)) {
			this._disconnectRunner1.schedule();
		} else {
			this.shutdown(true);
		}
	}