@@ -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,13 @@ 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
+ const { browsingContextId , serverSettings } = this ;
48
49
49
- const terminal = new LiteTerminalConnection ( { model, serverSettings } ) ;
50
+ const terminal = new LiteTerminalConnection ( {
51
+ browsingContextId,
52
+ model,
53
+ serverSettings
54
+ } ) ;
50
55
terminal . disposed . connect ( ( ) => this . shutdown ( name ) ) ;
51
56
return terminal ;
52
57
}
@@ -139,9 +144,13 @@ export class LiteTerminalManager
139
144
) : Promise < Terminal . ITerminalConnection > {
140
145
const name = options . name ?? this . _nextAvailableName ( ) ;
141
146
const model : Terminal . IModel = { name } ;
142
- const { serverSettings } = this ;
147
+ const { browsingContextId , serverSettings } = this ;
143
148
144
- const terminal = new LiteTerminalConnection ( { model, serverSettings } ) ;
149
+ const terminal = new LiteTerminalConnection ( {
150
+ browsingContextId,
151
+ model,
152
+ serverSettings
153
+ } ) ;
145
154
terminal . disposed . connect ( ( ) => this . shutdown ( name ) ) ;
146
155
this . _terminalConnections . set ( name , terminal ) ;
147
156
await this . refreshRunning ( ) ;
@@ -163,6 +172,7 @@ export class LiteTerminalManager
163
172
}
164
173
}
165
174
175
+ private readonly browsingContextId ?: string ;
166
176
private _connectionFailure = new Signal < this, Error > ( this ) ;
167
177
private _isReady = false ;
168
178
private _ready : Promise < void > ;
@@ -172,3 +182,12 @@ export class LiteTerminalManager
172
182
Terminal . ITerminalConnection
173
183
> ( ) ;
174
184
}
185
+
186
+ export namespace LiteTerminalManager {
187
+ export interface IOptions extends TerminalManager . IOptions {
188
+ /**
189
+ * The ID of the browsing context where the request originated.
190
+ */
191
+ browsingContextId ?: string ;
192
+ }
193
+ }
0 commit comments