Skip to content

Commit e9af68e

Browse files
authored
Local terminal should not wait for full window restore before initializing itself (microsoft#188191)
Fix microsoft/vscode-remote-release#8586
1 parent ac62da9 commit e9af68e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/vs/workbench/contrib/terminal/electron-sandbox/localTerminalBackend.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { DeferredPromise } from 'vs/base/common/async';
3737
import { IStatusbarService } from 'vs/workbench/services/statusbar/browser/statusbar';
3838
import { memoize } from 'vs/base/common/decorators';
3939
import { StopWatch } from 'vs/base/common/stopwatch';
40+
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
4041

4142
export 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

Comments
 (0)