Skip to content

Open hyperlinks in terminal output in the default browser - #23247

Open
akysil wants to merge 1 commit into
desktop:developmentfrom
akysil:fix/23211-links-in-git-hook-output-show-a-confirma
Open

akysil wants to merge 1 commit into
desktop:developmentfrom
akysil:fix/23211-links-in-git-hook-output-show-a-confirma

Conversation

@akysil

@akysil akysil commented Nov 28, 2026

Copy link
Copy Markdown

Closes #23211

Description

  • OSC 8 hyperlinks in terminal output (e.g. a failing hook's output in the "Commit failed" dialog) showed xterm's confirmation, but pressing OK did nothing. Without a linkHandler, xterm's default calls window.open() and then sets the new window's location; the main process denies every new window (Prevented new window to: about:blank in the log).
  • defaultTerminalOptions now provides a linkHandler that shows the same confirmation and, on OK, opens the URL in the default browser with shell.openExternal, as LinkButton does. xterm still only activates http(s) links, and callers can still pass their own linkHandler.
  • Approach: setting it in the shared Terminal defaults covers every dialog that renders terminal output. Alternatives considered: handling it only in the hook-failed dialog (other terminal surfaces stay broken) or allowing window.open in the main process (an app-wide change, and the handler only sees about:blank).
  • Added 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

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.
@akysil
akysil requested a review from a team as a code owner November 28, 2026 23:51
@akysil
akysil requested review from tidy-dev and a balanced review from Copilot November 28, 2026 23:51
@github-actions github-actions Bot added external Pull request originating outside of the Desktop core team needs-triage ready-for-review Pull Requests that are ready to be reviewed by the maintainers and removed needs-triage labels Nov 28, 2026
@github-actions

Copy link
Copy Markdown
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 help wanted label when possible, as it helps us prioritize and track contributions.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.openExternal when 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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Pull request originating outside of the Desktop core team ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Links in git hook output show a confirmation dialog but never open the URL

2 participants