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

fix(web): restore terminal link hover styles#5382
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.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c1d31778-1921-44ac-b64b-6024af71198d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 5, 2026
Comment thread apps/web/src/terminal/ghostty/surface.ts
Comment thread apps/web/src/terminal/ghostty/surface.ts
Comment thread apps/web/src/terminal/ghostty/surface.ts Outdated
Comment thread apps/web/src/terminal/ghostty/surface.ts
@macroscopeapp

macroscopeapp Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved b8e5747

Self-contained UI fix that restores terminal link hover underlines. Changes are well-tested and limited to the terminal rendering subsystem with no security or schema implications. Author is the primary contributor to these files.

You can customize Macroscope's approvability policy. Learn more.

Comment thread apps/web/src/terminal/ghostty/surface.ts
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 5, 2026
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 5, 2026 04:00

Dismissing prior approval to re-evaluate f2e6b6e

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f2e6b6e. Configure here.

Comment thread apps/web/src/terminal/ghostty/surface.ts
@juliusmarminge
juliusmarminge merged commit 9d9a872 into pingdotgg:main Aug 5, 2026
17 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 5, 2026
## What's Changed
* fix(mcp): unblock Kimi models in OpenCode with preview tools by @hwanseoc in pingdotgg/t3code#5128
* fix(web): clear main branch lint warnings by @t3dotgg in pingdotgg/t3code#5384
* fix(mobile): preserve grouped project workspaces by @shivamhwp in pingdotgg/t3code#4642
* fix(mobile): prevent Android thread search crash by @shivamhwp in pingdotgg/t3code#5386
* fix(web): truncate long project switcher names by @FllipEis in pingdotgg/t3code#5348
* fix(mobile): avoid double dividers between thread sections by @shivamhwp in pingdotgg/t3code#5391
* fix(web): keep the composer command menu anchored to the composer by @StiensWout in pingdotgg/t3code#5336
* fix(web): restore terminal link hover styles by @StiensWout in pingdotgg/t3code#5382
* fix(ci): isolate releases from shared API rate limits by @t3dotgg in pingdotgg/t3code#5394


**Full Changelog**: pingdotgg/t3code@v0.0.32-nightly.20260805.1002...v0.0.32-nightly.20260805.1005

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.32-nightly.20260805.1005
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 PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants