fix(terminal): open terminal URLs immediately during remote connect (#236398)#310834
Open
maruthang wants to merge 1 commit intomicrosoft:mainfrom
Open
fix(terminal): open terminal URLs immediately during remote connect (#236398)#310834maruthang wants to merge 1 commit intomicrosoft:mainfrom
maruthang wants to merge 1 commit intomicrosoft:mainfrom
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Terminal URL clicks now open immediately instead of deferring until remote extension host resolution completes.
Why
MainThreadUriOpeners.getOpeners()awaitedextensionService.activateByEvent(..., Normal), which waits on the_installedExtensionsReadybarrier. During remote authority resolution that barrier stays closed, so the Ctrl+click →OpenerService._doOpenExternal→ExternalUriOpenerService→MainThreadUriOpeners.getOpenerschain 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-1034documents this exact pattern for avoiding remote-resolution blocking.Test plan
New
mainThreadUriOpeners.test.tsuses aBlockingExtensionServicethat returns an unresolvable promise forActivationKind.Normaland resolves forActivationKind.Immediate(simulating production whereNormalwaits on_installedExtensionsReady). AssertsgetOpeners('https://...')completes,activateByEventis called withImmediate, and non-http(s) schemes early-return without activating.Fixes #236398