Repository navigation
Conversation
xterm's default link handler confirms and then calls window.open, which the main process denies, so OSC 8 links in hook output never opened. Use a link handler that keeps the confirmation and opens the URL with shell.openExternal.
Contributor
|
Thanks for your pull request! While it doesn't meet all of our standard requirements, it appears to be a small, focused contribution and has been routed to the team for review. Note: We still encourage linking to an issue with the |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change to open confirmed terminal hyperlinks in the default browser.
No open issues 🎉
What changed in this PR
This PR addresses #23211 by making confirmed OSC 8 hyperlinks in terminal output open in the default browser. The shared terminal defaults apply the fix across dialogs that display terminal output.
Changes:
- Adds a default link handler that preserves the confirmation prompt and calls
shell.openExternalwhen accepted. - Adds unit coverage for cancellation, confirmation text, and opening the exact URL once.
| File | Description |
|---|---|
app/test/unit/ui/terminal-test.tsx |
Tests the link handler’s confirmation and browser-opening behavior directly. |
app/src/ui/terminal.tsx |
Routes confirmed terminal hyperlinks to the default browser. |
Review effort: Balanced
This branch has not been deployed
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.
Closes #23211
Description
linkHandler, xterm's default callswindow.open()and then sets the new window's location; the main process denies every new window (Prevented new window to: about:blankin the log).defaultTerminalOptionsnow provides alinkHandlerthat shows the same confirmation and, on OK, opens the URL in the default browser withshell.openExternal, asLinkButtondoes. xterm still only activates http(s) links, and callers can still pass their ownlinkHandler.Terminaldefaults covers every dialog that renders terminal output. Alternatives considered: handling it only in the hook-failed dialog (other terminal surfaces stay broken) or allowingwindow.openin the main process (an app-wide change, and the handler only seesabout:blank).app/test/unit/ui/terminal-test.tsx: it checks the confirmation prompt (destination and warning), that Cancel opens nothing, and that OK opens the exact URL once. The test calls the handler directly, so it doesn't exercise xterm's OSC 8 parsing.Screenshots
No UI change: the dialog and confirmation look the same; the only difference is that the URL now opens in the default browser.
Release notes
Notes: [Fixed] Links in git hook output open in the default browser after confirming