mirror of
https://github.com/coder/code-server.git
synced 2024-11-23 20:52:38 +03:00
Handle non-persistent terminals
This commit is contained in:
parent
4de2511162
commit
8311cf5657
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user