Skip to content

fix(terminal): scheme-less links + OSC-8 markdown links clickable (v0.194.0)#323

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/terminal-links
Jul 14, 2026
Merged

fix(terminal): scheme-less links + OSC-8 markdown links clickable (v0.194.0)#323
vikasprogrammer merged 1 commit into
mainfrom
feat/terminal-links

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

What & why

Follow-up to the v0.192.0 terminal rework. You reported that plain-text links (bare domains) aren't auto-clickable — you had to ask agents for full URLs. Two real gaps, both now fixed and verified.

1. Link matchers were too narrow

  • A bare domain only clicked if its TLD was in a short list; a host/path with an unusual TLD didn't match at all.
  • Rewrote the matchers: a broad common gTLD/ccTLD list for bare domains (example.com, my-shop.store), and any multi-label host that carries a /path is treated as a URL (foo.bar/baz, docs.github.io/xterm) since the slash is a strong signal — while still not linking Component.tsx, src/main.rs, or version strings.
  • The provider is now registered after the renderer and wrapped in try/catch so a bad row can't break linkification.

2. tmux was silently stripping OSC-8 hyperlinks

  • Diagnosed via byte capture + xterm internals: claude emits OSC-8 for markdown links, but tmux drops every OSC-8 sequence unless the outer terminal is advertised as hyperlink-capable — so they never reached the browser (_dataByLinkId empty, cells had no link attr). That's why "full URLs work" was only true for the plain-text ones your agents typed.
  • Added hyperlinks to tmux's terminal-features; OSC-8 links now flow through and open on click via <Xterm>'s linkHandler.

How it was verified

  • Enhanced scripts/mouse-tui.mjs with realistic cases (trailing punctuation, in-sentence, parenthesised, uncommon TLD, an OSC-8 link, non-link tokens) and added termbed.html?strict=0 to reproduce the production single-run (no React StrictMode — which had been masking the gaps in the dev harness).
  • Playwright against the mouse-reporting harness: 13/13 in both StrictMode configs — bare/uncommon-TLD/path/www/localhost/OSC-8 all open the right target; Component.tsx and src/main.rs correctly do not.
  • typecheck, web build, server build, test:governance (68/68) green.

Deploy note

The tmux hyperlinks change is server-side — it needs a service restart (not just a web build) to take effect, and applies to newly-spawned sessions.

🤖 Generated with Claude Code

….195.0)

Two gaps from the v0.192.0 terminal rework:
- Custom link matchers were too narrow — a bare domain needed a short-listed
  TLD and host/path with an unusual TLD didn't match. Rewrote them: broad
  common-TLD list for bare domains, and any multi-label host carrying a /path
  is treated as a URL (the slash is a strong signal), while still not linking
  Component.tsx / src/main.rs / version strings. Provider registered after the
  renderer + wrapped so a bad row can't break linkification.
- tmux was stripping every OSC-8 hyperlink (claude's markdown links) before it
  reached the browser — the outer terminal wasn't advertised hyperlink-capable.
  Added `hyperlinks` to tmux terminal-features so they flow through and open via
  <Xterm>'s linkHandler.

Test bed prints realistic link cases + `?strict=0` reproduces the prod single-run
(no StrictMode). Verified 13/13 via Playwright against the mouse-reporting harness.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vikasprogrammer vikasprogrammer merged commit 6caea34 into main Jul 14, 2026
1 check passed
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.

1 participant