[PR #7280] feat: add OSC8 hyperlink support for clickable file paths and URLs #12333

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

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

State: open
Merged: No


Summary

Adds OSC8 hyperlink support to make file paths and URLs clickable in terminals that support it (iTerm2, Ghostty, Kitty, WezTerm, etc.).

Fixes #1168
Fixes #7273

Changes

  • Updated Link component to use native <a href> elements which OpenTUI renders as OSC8 hyperlinks
  • Added FilePathLink component for file paths that converts them to file:// URLs
  • Updated tool displays (Read, Write, Edit, Glob, Grep, List, WebFetch) to use clickable links for file paths and URLs

Why this fixes wrapped URL issues (#7273)

OSC8 hyperlinks embed the complete URL in an escape sequence that wraps the visible text. Even when the display text wraps across multiple lines, the terminal retains the full URL metadata, so clicking anywhere on the wrapped link opens the complete URL.

Usage

In supported terminals, Shift+click on file paths or URLs to open them. The exact modifier key depends on your terminal's configuration.

Testing

Tested in Ghostty - file paths open in default editor, URLs open in browser.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7280 **State:** open **Merged:** No --- ## Summary Adds OSC8 hyperlink support to make file paths and URLs clickable in terminals that support it (iTerm2, Ghostty, Kitty, WezTerm, etc.). Fixes #1168 Fixes #7273 ## Changes - Updated `Link` component to use native `<a href>` elements which OpenTUI renders as OSC8 hyperlinks - Added `FilePathLink` component for file paths that converts them to `file://` URLs - Updated tool displays (Read, Write, Edit, Glob, Grep, List, WebFetch) to use clickable links for file paths and URLs ## Why this fixes wrapped URL issues (#7273) OSC8 hyperlinks embed the complete URL in an escape sequence that wraps the visible text. Even when the display text wraps across multiple lines, the terminal retains the full URL metadata, so clicking anywhere on the wrapped link opens the complete URL. ## Usage In supported terminals, Shift+click on file paths or URLs to open them. The exact modifier key depends on your terminal's configuration. ## Testing Tested in Ghostty - file paths open in default editor, URLs open in browser.
yindo added the pull-request label 2026-02-16 18:17:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12333