@@ -37,6 +37,7 @@ import { DeferredPromise } from 'vs/base/common/async';
3737import { IStatusbarService } from 'vs/workbench/services/statusbar/browser/statusbar' ;
3838import { memoize } from 'vs/base/common/decorators' ;
3939import { StopWatch } from 'vs/base/common/stopwatch' ;
40+ import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService' ;
4041
4142export class LocalTerminalBackendContribution implements IWorkbenchContribution {
4243 constructor (
@@ -87,6 +88,7 @@ class LocalTerminalBackend extends BaseTerminalBackend implements ITerminalBacke
8788 @IHistoryService historyService : IHistoryService ,
8889 @INativeWorkbenchEnvironmentService private readonly _environmentService : INativeWorkbenchEnvironmentService ,
8990 @IStatusbarService statusBarService : IStatusbarService ,
91+ @IRemoteAgentService private readonly _remoteAgentService : IRemoteAgentService ,
9092 ) {
9193 super ( _localPtyService , logService , historyService , _configurationResolverService , statusBarService , workspaceContextService ) ;
9294
@@ -110,7 +112,10 @@ class LocalTerminalBackend extends BaseTerminalBackend implements ITerminalBacke
110112 this . _directProxy = directProxy ;
111113
112114 // The pty host should not get launched until at least the window restored phase
113- await this . _lifecycleService . when ( LifecyclePhase . Restored ) ;
115+ // if remote auth exists, don't await
116+ if ( ! this . _remoteAgentService . getConnection ( ) ?. remoteAuthority ) {
117+ await this . _lifecycleService . when ( LifecyclePhase . Restored ) ;
118+ }
114119
115120 mark ( 'code/terminal/willConnectPtyHost' ) ;
116121 this . _logService . trace ( 'Renderer->PtyHost#connect: before acquirePort' ) ;
0 commit comments