1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2024-12-26 12:15:26 +00:00

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 = ""; + private _title: string = "";
+ public readonly workspaceId: string; + public readonly workspaceId: string;
+ public readonly workspaceName: string; + public readonly workspaceName: string;
+ private readonly persist: boolean;
+ +
+ private readonly _onDispose = new Emitter<void>(); + private readonly _onDispose = new Emitter<void>();
+ public get onDispose(): Event<void> { return this._onDispose.event; } + public get onDispose(): Event<void> { return this._onDispose.event; }
@ -1918,6 +1919,13 @@ index 0000000000000000000000000000000000000000..cb3a45fda10a6bcbff73275b5734641b
+ data: this.replayData.join(""), + 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.cols = args.cols;
+ this.rows = args.rows; + this.rows = args.rows;
+ +
+ this.persist = args.shouldPersistTerminal;
+
+ this.process = new TerminalProcess( + this.process = new TerminalProcess(
+ config, + config,
+ config.cwd, + config.cwd,