Skip to content

fix(#3165): OSC 8 hyperlinks not opening in the terminal#3384

Open
nino-robotfutures-co wants to merge 1 commit into
wavetermdev:mainfrom
nino-robotfutures-co:fix/osc8-link-navigation
Open

fix(#3165): OSC 8 hyperlinks not opening in the terminal#3384
nino-robotfutures-co wants to merge 1 commit into
wavetermdev:mainfrom
nino-robotfutures-co:fix/osc8-link-navigation

Conversation

@nino-robotfutures-co

@nino-robotfutures-co nino-robotfutures-co commented Jun 18, 2026

Copy link
Copy Markdown

OSC 8 escape-sequence hyperlinks are handled by xterm's internal OSC link provider, which uses the Terminal linkHandler option. We never set one, so it fell back to xterm's built-in default handler that calls window.open() with no URL and then assigns location.href. Under Electron the resulting about:blank open is denied by the window-open handler (it only forwards http/https/file URLs to shell.openExternal), so the link silently never opened — the confirm dialog appeared but nothing happened.

Provide a linkHandler that routes OSC 8 links through the same openLink path already used for URLs detected by the WebLinksAddon. The activate/hover/ leave behavior is factored into shared closures so both link types behave identically (including hover, which enables the "Open in External Browser" context menu on OSC 8 links).

Closes #3165

OSC 8 escape-sequence hyperlinks are handled by xterm's internal OSC link
provider, which uses the Terminal `linkHandler` option. We never set one, so
it fell back to xterm's built-in default handler that calls `window.open()`
with no URL and then assigns `location.href`. Under Electron the resulting
`about:blank` open is denied by the window-open handler (it only forwards
http/https/file URLs to shell.openExternal), so the link silently never
opened — the confirm dialog appeared but nothing happened.

Provide a `linkHandler` that routes OSC 8 links through the same `openLink`
path already used for URLs detected by the WebLinksAddon. The activate/hover/
leave behavior is factored into shared closures so both link types behave
identically (including hover, which enables the "Open in External Browser"
context menu on OSC 8 links).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7ceff6f6-2822-4e72-9d4e-ae8c04af7e8a

📥 Commits

Reviewing files that changed from the base of the PR and between 22197d4 and 18e3e9e.

📒 Files selected for processing (1)
  • frontend/app/view/term/termwrap.ts

Walkthrough

The TermWrap constructor in termwrap.ts is refactored to define three named local functions—activateLink, linkHover, and linkLeave—that consolidate all hyperlink interaction logic in one place. activateLink gates execution on the correct platform modifier key (Cmd on macOS, Ctrl elsewhere) and calls openLink(uri) via fireAndForget. linkHover updates hoveredLinkUri and invokes onLinkHover with mouse coordinates; linkLeave clears those values. These functions are then assigned to options.linkHandler (for OSC 8 links) and passed directly to the WebLinksAddon constructor, replacing previously duplicated inline callbacks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing OSC 8 hyperlinks not opening in the terminal, which is the primary objective of this pull request.
Description check ✅ Passed The description is directly related to the changeset, explaining the root cause of the issue, the implementation approach, and how it resolves the problem by routing OSC 8 links through the existing openLink path.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nino-robotfutures-co

Copy link
Copy Markdown
Author

I've signed the license; but it's not refreshing status here, despite pressing the nudge button; that's also the cause of the merge gatekeeper failure.

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.

[Bug]: OSC 8 hyperlinks show confirmation dialog but do not open browser

3 participants