Skip to content

fix(web): restore terminal link hover styles - #5382

Merged
juliusmarminge merged 4 commits into
pingdotgg:mainfrom
StiensWout:t3code/fix/terminal-link-hover-styles
Aug 5, 2026
Merged

juliusmarminge merged 4 commits into
pingdotgg:mainfrom
StiensWout:t3code/fix/terminal-link-hover-styles

Conversation

@StiensWout

@StiensWout StiensWout commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The Ghostty canvas migration preserved terminal link hit-testing and activation, but did not carry over xterm's hover decorations. URLs and file paths still opened with Ctrl/Cmd-click, yet there was no underline or pointer feedback to show that they were interactive.

Fix

  • track the hovered implicit or OSC 8 terminal link and its complete cell range
  • show the pointer cursor without requiring the activation modifier
  • repaint the full link underline on hover, including wrapped links and links after wide characters
  • keep Ctrl/Cmd-click as the activation safeguard

Verification

  • ../../node_modules/.bin/vp test run --project unit src/terminal/ghostty/surface.test.ts src/terminal/ghostty/renderer.test.ts (40 tests)
  • vp run --filter @t3tools/web typecheck
  • targeted vp lint and vp fmt --check
  • Playwright interaction against an isolated T3 web environment

Ghostty terminal link hover proof

Generated with GPT-5.6-Sol in T3 Code (Codex harness).


Note

Low Risk
Terminal UI and pointer/render paths only; behavior is covered by unit tests and does not change link activation or PTY I/O semantics.

Overview
Brings back xterm-style link hover feedback on the Ghostty canvas terminal: pointer cursor and underlines on implicit URLs/paths and OSC 8 links, without requiring Ctrl/Cmd until click.

Link resolution now returns a full cell range (terminalLinkAtPositionWithRange, plus range expansion for explicit hyperlinks across soft wraps). Hit-testing uses terminalGridCellAt so pointers outside the padded grid do not clamp to edge cells.

Rendering passes hoveredLinkRange into renderGhosttySnapshot, which underlines every cell in the range (including multi-row wraps). The surface tracks hover on move, clears on leave/selection drags, and suppresses hover during mouse-tracking unless the link modifier is held (shouldShowTerminalLinkHover); modifier key state updates on keydown/keyup and blur.

Activation is unchanged: onLinkActivate still receives link text only on Ctrl/Cmd-click.

Reviewed by Cursor Bugbot for commit b8e5747. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Restore terminal link hover styles with underline rendering and cursor feedback

  • Adds hoveredLinkRange tracking to GhosttyTerminalSurface so that when a user hovers over a link, the full cell range (including wrapped lines) is underlined during rendering.
  • Introduces terminalGridCellAt, terminalLinkAtPositionWithRange, and shouldShowTerminalLinkHover utilities in surface.ts to map pointer coordinates to grid cells and determine when hover feedback is appropriate.
  • Suppresses link hover UI while application mouse tracking is active unless the link modifier key is held.
  • Extends renderGhosttySnapshot in renderer.ts to accept an optional hoveredLinkRange and underline all cells within that range, including across row wraps.

Macroscope summarized b8e5747.

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

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants