src/vs/workbench/contrib/terminal/browser/terminalInstance.ts/TerminalInstance/detachProcessAndDispose
class TerminalInstance:	async detachProcessAndDispose(reason: TerminalExitReason): Promise<void> {
		// Detach the process and dispose the instance, without the instance dispose the terminal
		// won't go away. Force persist if the detach was requested by the user (not shutdown).
		await this._processManager.detachFromProcess(reason === TerminalExitReason.User);
		this.dispose(reason);
	}