@@ -12,8 +12,9 @@ export class LiteTerminalManager
12
12
/**
13
13
* Construct a new terminal manager.
14
14
*/
15
- constructor ( options : TerminalManager . IOptions = { } ) {
15
+ constructor ( options : LiteTerminalManager . IOptions ) {
16
16
super ( options ) ;
17
+ this . browsingContextId = options . browsingContextId ;
17
18
18
19
// Initialize internal data.
19
20
this . _ready = ( async ( ) => {
@@ -44,9 +45,9 @@ export class LiteTerminalManager
44
45
const { model } = options ;
45
46
const { name } = model ;
46
47
console . log ( '==> LiteTerminalManager.connectTo' , name ) ;
47
- const { serverSettings } = this ;
48
-
49
- const terminal = new LiteTerminalConnection ( { model, serverSettings } ) ;
48
+ const { browsingContextId , serverSettings } = this ;
49
+
50
+ const terminal = new LiteTerminalConnection ( { browsingContextId , model, serverSettings } ) ;
50
51
terminal . disposed . connect ( ( ) => this . shutdown ( name ) ) ;
51
52
return terminal ;
52
53
}
@@ -139,9 +140,9 @@ export class LiteTerminalManager
139
140
) : Promise < Terminal . ITerminalConnection > {
140
141
const name = options . name ?? this . _nextAvailableName ( ) ;
141
142
const model : Terminal . IModel = { name } ;
142
- const { serverSettings } = this ;
143
+ const { browsingContextId , serverSettings } = this ;
143
144
144
- const terminal = new LiteTerminalConnection ( { model, serverSettings } ) ;
145
+ const terminal = new LiteTerminalConnection ( { browsingContextId , model, serverSettings } ) ;
145
146
terminal . disposed . connect ( ( ) => this . shutdown ( name ) ) ;
146
147
this . _terminalConnections . set ( name , terminal ) ;
147
148
await this . refreshRunning ( ) ;
@@ -163,6 +164,7 @@ export class LiteTerminalManager
163
164
}
164
165
}
165
166
167
+ private readonly browsingContextId ?: string ;
166
168
private _connectionFailure = new Signal < this, Error > ( this ) ;
167
169
private _isReady = false ;
168
170
private _ready : Promise < void > ;
@@ -172,3 +174,12 @@ export class LiteTerminalManager
172
174
Terminal . ITerminalConnection
173
175
> ( ) ;
174
176
}
177
+
178
+ export namespace LiteTerminalManager {
179
+ export interface IOptions extends TerminalManager . IOptions {
180
+ /**
181
+ * The ID of the browsing context where the request originated.
182
+ */
183
+ browsingContextId ?: string ;
184
+ }
185
+ }
0 commit comments