@@ -87,6 +87,9 @@ class LocalTerminalBackend extends BaseTerminalBackend implements ITerminalBacke
87
87
this . _proxy = ProxyChannel . toService < IPtyService > ( getDelayedChannel ( clientEventually . p . then ( client => client . getChannel ( TerminalIpcChannels . PtyHostWindow ) ) ) ) ;
88
88
this . _connectToDirectProxy ( clientEventually ) ;
89
89
} ) ) ;
90
+
91
+ // Eagerly fetch the backend's environment for memoization
92
+ this . getEnvironment ( ) ;
90
93
}
91
94
92
95
private async _connectToDirectProxy ( clientEventually : DeferredPromise < MessagePortClient > ) : Promise < void > {
@@ -242,6 +245,7 @@ class LocalTerminalBackend extends BaseTerminalBackend implements ITerminalBacke
242
245
return this . _proxy . getEnvironment ( ) ;
243
246
}
244
247
248
+ @memoize
245
249
async getShellEnvironment ( ) : Promise < IProcessEnvironment > {
246
250
return this . _shellEnvironmentService . getShellEnv ( ) ;
247
251
}
@@ -288,15 +292,15 @@ class LocalTerminalBackend extends BaseTerminalBackend implements ITerminalBacke
288
292
mark ( 'code/terminal/didGetReviveEnvironments' ) ;
289
293
290
294
mark ( 'code/terminal/willReviveTerminalProcesses' ) ;
291
- await this . _localPtyService . reviveTerminalProcesses ( parsed , Intl . DateTimeFormat ( ) . resolvedOptions ( ) . locale ) ;
295
+ await this . _proxy . reviveTerminalProcesses ( parsed , Intl . DateTimeFormat ( ) . resolvedOptions ( ) . locale ) ;
292
296
mark ( 'code/terminal/didReviveTerminalProcesses' ) ;
293
297
this . _storageService . remove ( TerminalStorageKeys . TerminalBufferState , StorageScope . WORKSPACE ) ;
294
298
// If reviving processes, send the terminal layout info back to the pty host as it
295
299
// will not have been persisted on application exit
296
300
const layoutInfo = this . _storageService . get ( TerminalStorageKeys . TerminalLayoutInfo , StorageScope . WORKSPACE ) ;
297
301
if ( layoutInfo ) {
298
302
mark ( 'code/terminal/willSetTerminalLayoutInfo' ) ;
299
- await this . _localPtyService . setTerminalLayoutInfo ( JSON . parse ( layoutInfo ) ) ;
303
+ await this . _proxy . setTerminalLayoutInfo ( JSON . parse ( layoutInfo ) ) ;
300
304
mark ( 'code/terminal/didSetTerminalLayoutInfo' ) ;
301
305
this . _storageService . remove ( TerminalStorageKeys . TerminalLayoutInfo , StorageScope . WORKSPACE ) ;
302
306
}
@@ -305,7 +309,7 @@ class LocalTerminalBackend extends BaseTerminalBackend implements ITerminalBacke
305
309
}
306
310
}
307
311
308
- return this . _localPtyService . getTerminalLayoutInfo ( layoutArgs ) ;
312
+ return this . _proxy . getTerminalLayoutInfo ( layoutArgs ) ;
309
313
}
310
314
311
315
private async _resolveEnvironmentForRevive ( variableResolver : terminalEnvironment . VariableResolver | undefined , shellLaunchConfig : IShellLaunchConfig ) : Promise < IProcessEnvironment > {
0 commit comments