Handle non-persistent terminals

This commit is contained in:
Asher 2020-11-17 17:51:17 -06:00
parent 4de2511162
commit 8311cf5657
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A

View File

@ -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<void>();
+ public get onDispose(): Event<void> { 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,