Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local terminal should not wait for full window restore before initializing itself #188191

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { DeferredPromise } from 'vs/base/common/async';
import { IStatusbarService } from 'vs/workbench/services/statusbar/browser/statusbar';
import { memoize } from 'vs/base/common/decorators';
import { StopWatch } from 'vs/base/common/stopwatch';
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';

export class LocalTerminalBackendContribution implements IWorkbenchContribution {
constructor(
Expand Down Expand Up @@ -87,6 +88,7 @@ class LocalTerminalBackend extends BaseTerminalBackend implements ITerminalBacke
@IHistoryService historyService: IHistoryService,
@INativeWorkbenchEnvironmentService private readonly _environmentService: INativeWorkbenchEnvironmentService,
@IStatusbarService statusBarService: IStatusbarService,
@IRemoteAgentService private readonly _remoteAgentService: IRemoteAgentService,
) {
super(_localPtyService, logService, historyService, _configurationResolverService, statusBarService, workspaceContextService);

Expand All @@ -110,7 +112,10 @@ class LocalTerminalBackend extends BaseTerminalBackend implements ITerminalBacke
this._directProxy = directProxy;

// The pty host should not get launched until at least the window restored phase
await this._lifecycleService.when(LifecyclePhase.Restored);
// if remote auth exists, don't await
if (!this._remoteAgentService.getConnection()?.remoteAuthority) {
await this._lifecycleService.when(LifecyclePhase.Restored);
}

mark('code/terminal/willConnectPtyHost');
this._logService.trace('Renderer->PtyHost#connect: before acquirePort');
Expand Down