@@ -22,7 +22,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
2222 private _proxy : ExtHostTerminalServiceShape ;
2323 private _remoteAuthority : string | null ;
2424 private readonly _toDispose = new DisposableStore ( ) ;
25- private readonly _terminalProcesses = new Map < number , Promise < ITerminalProcessExtHostProxy > > ( ) ;
25+ private readonly _terminalProcessProxies = new Map < number , ITerminalProcessExtHostProxy > ( ) ;
2626 private _dataEventTracker : TerminalDataEventTracker | undefined ;
2727 private _linkHandler : IDisposable | undefined ;
2828
@@ -230,7 +230,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
230230 }
231231
232232 const proxy = request . proxy ;
233- this . _terminalProcesses . set ( proxy . terminalId , Promise . resolve ( proxy ) ) ;
233+ this . _terminalProcessProxies . set ( proxy . terminalId , proxy ) ;
234234 const shellLaunchConfigDto : IShellLaunchConfigDto = {
235235 name : request . shellLaunchConfig . name ,
236236 executable : request . shellLaunchConfig . executable ,
@@ -258,7 +258,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
258258
259259 private _onRequestStartExtensionTerminal ( request : IStartExtensionTerminalRequest ) : void {
260260 const proxy = request . proxy ;
261- this . _terminalProcesses . set ( proxy . terminalId , Promise . resolve ( proxy ) ) ;
261+ this . _terminalProcessProxies . set ( proxy . terminalId , proxy ) ;
262262
263263 // Note that onReisze is not being listened to here as it needs to fire when max dimensions
264264 // change, excluding the dimension override
@@ -280,38 +280,38 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
280280 }
281281
282282 public $sendProcessTitle ( terminalId : number , title : string ) : void {
283- this . _getTerminalProcess ( terminalId ) . then ( e => e . emitTitle ( title ) ) ;
283+ this . _getTerminalProcess ( terminalId ) . emitTitle ( title ) ;
284284 }
285285
286286 public $sendProcessData ( terminalId : number , data : string ) : void {
287- this . _getTerminalProcess ( terminalId ) . then ( e => e . emitData ( data ) ) ;
287+ this . _getTerminalProcess ( terminalId ) . emitData ( data ) ;
288288 }
289289
290290 public $sendProcessReady ( terminalId : number , pid : number , cwd : string ) : void {
291- this . _getTerminalProcess ( terminalId ) . then ( e => e . emitReady ( pid , cwd ) ) ;
291+ this . _getTerminalProcess ( terminalId ) . emitReady ( pid , cwd ) ;
292292 }
293293
294294 public $sendProcessExit ( terminalId : number , exitCode : number | undefined ) : void {
295- this . _getTerminalProcess ( terminalId ) . then ( e => e . emitExit ( exitCode ) ) ;
296- this . _terminalProcesses . delete ( terminalId ) ;
295+ this . _getTerminalProcess ( terminalId ) . emitExit ( exitCode ) ;
296+ this . _terminalProcessProxies . delete ( terminalId ) ;
297297 }
298298
299299 public $sendOverrideDimensions ( terminalId : number , dimensions : ITerminalDimensions | undefined ) : void {
300- this . _getTerminalProcess ( terminalId ) . then ( e => e . emitOverrideDimensions ( dimensions ) ) ;
300+ this . _getTerminalProcess ( terminalId ) . emitOverrideDimensions ( dimensions ) ;
301301 }
302302
303303 public $sendProcessInitialCwd ( terminalId : number , initialCwd : string ) : void {
304- this . _getTerminalProcess ( terminalId ) . then ( e => e . emitInitialCwd ( initialCwd ) ) ;
304+ this . _getTerminalProcess ( terminalId ) . emitInitialCwd ( initialCwd ) ;
305305 }
306306
307307 public $sendProcessCwd ( terminalId : number , cwd : string ) : void {
308- this . _getTerminalProcess ( terminalId ) . then ( e => e . emitCwd ( cwd ) ) ;
308+ this . _getTerminalProcess ( terminalId ) . emitCwd ( cwd ) ;
309309 }
310310
311311 public $sendResolvedLaunchConfig ( terminalId : number , shellLaunchConfig : IShellLaunchConfig ) : void {
312312 const instance = this . _terminalService . getInstanceFromId ( terminalId ) ;
313313 if ( instance ) {
314- this . _getTerminalProcess ( terminalId ) . then ( e => e . emitResolvedShellLaunchConfig ( shellLaunchConfig ) ) ;
314+ this . _getTerminalProcess ( terminalId ) . emitResolvedShellLaunchConfig ( shellLaunchConfig ) ;
315315 }
316316 }
317317
@@ -324,7 +324,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
324324 sw . stop ( ) ;
325325 sum += sw . elapsed ( ) ;
326326 }
327- this . _getTerminalProcess ( terminalId ) . then ( e => e . emitLatency ( sum / COUNT ) ) ;
327+ this . _getTerminalProcess ( terminalId ) . emitLatency ( sum / COUNT ) ;
328328 }
329329
330330 private _isPrimaryExtHost ( ) : boolean {
@@ -349,8 +349,8 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
349349 }
350350 }
351351
352- private _getTerminalProcess ( terminalId : number ) : Promise < ITerminalProcessExtHostProxy > {
353- const terminal = this . _terminalProcesses . get ( terminalId ) ;
352+ private _getTerminalProcess ( terminalId : number ) : ITerminalProcessExtHostProxy {
353+ const terminal = this . _terminalProcessProxies . get ( terminalId ) ;
354354 if ( ! terminal ) {
355355 throw new Error ( `Unknown terminal: ${ terminalId } ` ) ;
356356 }
0 commit comments