From 8311cf5657c7264c71373f1f15e0016da9336364 Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 17 Nov 2020 17:51:17 -0600 Subject: [PATCH] Handle non-persistent terminals --- ci/dev/vscode.patch | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ci/dev/vscode.patch b/ci/dev/vscode.patch index 49058f4f..949bed3f 100644 --- a/ci/dev/vscode.patch +++ b/ci/dev/vscode.patch @@ -1880,6 +1880,7 @@ index 0000000000000000000000000000000000000000..cb3a45fda10a6bcbff73275b5734641b + private _title: string = ""; + public readonly workspaceId: string; + public readonly workspaceName: string; ++ private readonly persist: boolean; + + private readonly _onDispose = new Emitter(); + public get onDispose(): Event { return this._onDispose.event; } @@ -1918,6 +1919,13 @@ index 0000000000000000000000000000000000000000..cb3a45fda10a6bcbff73275b5734641b + data: this.replayData.join(""), + }] + }); ++ }, ++ ++ onLastListenerRemove: () => { ++ logger.debug('Terminal unbound', field('id', this.id)); ++ if (!this.persist) { // Used by debug consoles. ++ this.dispose(); ++ } + } + }); + @@ -1979,6 +1987,8 @@ index 0000000000000000000000000000000000000000..cb3a45fda10a6bcbff73275b5734641b + this.cols = args.cols; + this.rows = args.rows; + ++ this.persist = args.shouldPersistTerminal; ++ + this.process = new TerminalProcess( + config, + config.cwd,