Skip to content

fix(terminal): open terminal URLs immediately during remote connect (#236398)#310834

Open
maruthang wants to merge 1 commit intomicrosoft:mainfrom
maruthang:fix/issue-236398-terminal-url-remote-connect
Open

fix(terminal): open terminal URLs immediately during remote connect (#236398)#310834
maruthang wants to merge 1 commit intomicrosoft:mainfrom
maruthang:fix/issue-236398-terminal-url-remote-connect

Conversation

@maruthang
Copy link
Copy Markdown
Contributor

What

Terminal URL clicks now open immediately instead of deferring until remote extension host resolution completes.

Why

MainThreadUriOpeners.getOpeners() awaited extensionService.activateByEvent(..., Normal), which waits on the _installedExtensionsReady barrier. During remote authority resolution that barrier stays closed, so the Ctrl+click → OpenerService._doOpenExternalExternalUriOpenerServiceMainThreadUriOpeners.getOpeners chain blocks until the connection is fully up. URLs printed during connect (e.g. 2FA login prompts) felt broken (#236398).

How

Pass ActivationKind.Immediate. Already-ready hosts still activate the event; remote hosts that haven't resolved yet are skipped so the URL falls through to the default external opener and opens in the browser. Precedent: abstractExtensionService.ts:1025-1034 documents this exact pattern for avoiding remote-resolution blocking.

Test plan

New mainThreadUriOpeners.test.ts uses a BlockingExtensionService that returns an unresolvable promise for ActivationKind.Normal and resolves for ActivationKind.Immediate (simulating production where Normal waits on _installedExtensionsReady). Asserts getOpeners('https://...') completes, activateByEvent is called with Immediate, and non-http(s) schemes early-return without activating.

Fixes #236398

…icrosoft#236398)

Use ActivationKind.Immediate when calling activateByEvent for
'onOpenExternalUri:{scheme}' in MainThreadUriOpeners.getOpeners.

Previously, the default Normal activation kind awaited the
_installedExtensionsReady barrier, which stays closed until the remote
authority has been resolved and remote extensions processed. If the user
CTRL+clicked a URL printed by the remote server during connection
(e.g. a 2FA link), the opener call blocked until the connection
completed, at which point the URL finally opened. Switching to Immediate
activates the event on currently-ready extension hosts only and returns
straight away so the click falls through to the default opener and the
browser opens right away.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clicking URLs in terminal while connecting are opened only after connecting

2 participants