[PR #6995] fix(tui): use OSC 8 hyperlinks for multiline link support #12192

Closed
opened 2026-02-16 18:17:07 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6995

State: closed
Merged: No


Summary

  • Use <a href> element to generate OSC 8 terminal hyperlinks for the Link component
  • OSC 8 hyperlinks correctly span multiple wrapped lines in supporting terminals
  • Keep onMouseUp handler as fallback for terminals without OSC 8 support

Problem

When authorization URLs wrap across multiple lines in the dialog, clicking on the wrapped portion doesn't open the URL (issue #6639).

Solution

Wrap the link text in an <a href> element which generates OSC 8 terminal escape sequences. These hyperlinks are handled natively by the terminal and work correctly across line wraps. The onMouseUp handler is preserved as a fallback.

Test plan

  • Verified typecheck passes
  • OSC 8 hyperlinks are supported by most modern terminals (iTerm2, Ghostty, Kitty, Windows Terminal, etc.)

Fixes #6639

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6995 **State:** closed **Merged:** No --- ## Summary - Use `<a href>` element to generate OSC 8 terminal hyperlinks for the Link component - OSC 8 hyperlinks correctly span multiple wrapped lines in supporting terminals - Keep `onMouseUp` handler as fallback for terminals without OSC 8 support ## Problem When authorization URLs wrap across multiple lines in the dialog, clicking on the wrapped portion doesn't open the URL (issue #6639). ## Solution Wrap the link text in an `<a href>` element which generates OSC 8 terminal escape sequences. These hyperlinks are handled natively by the terminal and work correctly across line wraps. The `onMouseUp` handler is preserved as a fallback. ## Test plan - Verified typecheck passes - OSC 8 hyperlinks are supported by most modern terminals (iTerm2, Ghostty, Kitty, Windows Terminal, etc.) Fixes #6639
yindo added the pull-request label 2026-02-16 18:17:07 -05:00
yindo closed this issue 2026-02-16 18:17:07 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12192