@@ -37,6 +37,7 @@ import { DeferredPromise } from 'vs/base/common/async';
37
37
import { IStatusbarService } from 'vs/workbench/services/statusbar/browser/statusbar' ;
38
38
import { memoize } from 'vs/base/common/decorators' ;
39
39
import { StopWatch } from 'vs/base/common/stopwatch' ;
40
+ import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService' ;
40
41
41
42
export class LocalTerminalBackendContribution implements IWorkbenchContribution {
42
43
constructor (
@@ -87,6 +88,7 @@ class LocalTerminalBackend extends BaseTerminalBackend implements ITerminalBacke
87
88
@IHistoryService historyService : IHistoryService ,
88
89
@INativeWorkbenchEnvironmentService private readonly _environmentService : INativeWorkbenchEnvironmentService ,
89
90
@IStatusbarService statusBarService : IStatusbarService ,
91
+ @IRemoteAgentService private readonly _remoteAgentService : IRemoteAgentService ,
90
92
) {
91
93
super ( _localPtyService , logService , historyService , _configurationResolverService , statusBarService , workspaceContextService ) ;
92
94
@@ -110,7 +112,10 @@ class LocalTerminalBackend extends BaseTerminalBackend implements ITerminalBacke
110
112
this . _directProxy = directProxy ;
111
113
112
114
// 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
+ }
114
119
115
120
mark ( 'code/terminal/willConnectPtyHost' ) ;
116
121
this . _logService . trace ( 'Renderer->PtyHost#connect: before acquirePort' ) ;
0 commit comments