feat(ui-tui): make link-opening discoverable per terminal#701
Merged
Conversation
Agent-printed links looked broken in Apple Terminal: it has no OSC 8 hyperlink support (still true on macOS 26), and inline mode deliberately never captures the mouse, so the only working affordance is Apple Terminal's native URL detection — hold Cmd and double-click the URL. That gesture was undocumented, so users clicked and got nothing. - One-time dim transcript tip under the first assistant message that contains a URL, only in Apple Terminal (linkTipFor, wired at message.complete after the message it explains). - ? quick help + /help now list the terminal-appropriate gesture: "Cmd+click link" in OSC 8 terminals, "Cmd+double-click URL" in Apple Terminal, omitted when the terminal's gesture is unknown. - supportsHyperlinks now recognizes TERM_PROGRAM=vscode (VS Code, Cursor, Windsurf): xterm.js has handled OSC 8 Cmd+click since 2022. Exported from @clawcodex/ink for app-level use. Verified live via PTY+pyte in both terminal identities, including raw OSC 8 byte framing (balanced regions, id= grouping, label and URL in one region). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ericleepi314
added a commit
that referenced
this pull request
Jul 12, 2026
Follow-up to #701 from user feedback ("the user needs to know the link is clickable"): the hover affordance exists, but nothing said so. - OSC 8 terminals row: "(Cmd/Ctrl+hover underlines it)" — the terminal's own native hover indicator (VS Code/iTerm2/kitty...). - Fullscreen row: "(highlights on hover)" — the renderer's own hover overlay (applyHyperlinkHoverHighlight inverts the link's cells), verified live by injecting SGR mouse-motion events in a PTY e2e. No modifier-gated variant is possible: terminals don't encode the Cmd key in SGR mouse reports, and inline mode receives no mouse events at all (Apple Terminal inline can't have a hover indicator, full stop). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ericleepi314
added a commit
that referenced
this pull request
Jul 12, 2026
…704) Follow-up to #701 from user feedback ("the user needs to know the link is clickable"): the hover affordance exists, but nothing said so. - OSC 8 terminals row: "(Cmd/Ctrl+hover underlines it)" — the terminal's own native hover indicator (VS Code/iTerm2/kitty...). - Fullscreen row: "(highlights on hover)" — the renderer's own hover overlay (applyHyperlinkHoverHighlight inverts the link's cells), verified live by injecting SGR mouse-motion events in a PTY e2e. No modifier-gated variant is possible: terminals don't encode the Cmd key in SGR mouse reports, and inline mode receives no mouse events at all (Apple Terminal inline can't have a hover indicator, full stop). Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
Links the agent prints looked broken in Apple Terminal: "I saw these links but I cannot click on them to open the link."
Diagnosis (verified empirically via raw PTY byte capture + terminal-support research):
id=grouping wrappinglabel (url)— so Cmd+click already works in VS Code/iTerm2/kitty/Ghostty/WezTerm.Change
tip: to open links in Apple Terminal, hold ⌘ and double-click the URL. Lands viasys()directly under the links it explains; once per session.?quick help +/helpnow list the link gesture per terminal:Cmd+click linkin OSC 8 terminals,Cmd+double-click URLin Apple Terminal (inline),click linkin fullscreen mode (mouse tracking armed → in-process opener works everywhere), omitted when unknown. Preview widened to 9 rows so Tab-completion stays visible.supportsHyperlinksnow recognizesTERM_PROGRAM=vscode(VS Code since 1.72, Cursor, Windsurf — xterm.js handles OSC 8 Cmd+click). It had no functional consumers in the renderer (links are emitted unconditionally), so this only affects gesture advertising. Exported from@clawcodex/ink.Verification
LC_TERMINAL=iTerm2 TERM=xterm-kitty).Cmd+double-click URLrow; vscode+inline → no tip +Cmd+click linkrow; Apple_Terminal+fullscreen → no tip +click linkrow. Raw OSC 8 framing re-verified balanced in all captures.🤖 Generated with Claude Code