Skip to content

Conversation

@brendandebeasi
Copy link

@brendandebeasi brendandebeasi commented Jan 8, 2026

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.

- Update Link component to use native <a> element with OSC8 escape sequences
- Add FilePathLink component for file:// URLs (Cmd/Ctrl+click to open)
- Update tool displays (Read, Write, Edit, Glob, Grep, List, WebFetch) to use clickable links
- Update BlockTool to support JSX titles for clickable file paths in headers

Enables Cmd+click (macOS) or Ctrl+click (Linux/Windows) on URLs and file paths
in terminals that support OSC8 hyperlinks (iTerm2, Windows Terminal, etc.)

Closes anomalyco#1168
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@brendandebeasi
Copy link
Author

@rekram1-node sending this up as thanks for your ninja-fast session naming fix earlier today <3

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Incomplete link navigation when URL is wrapped across multiple lines in terminal Feature Request: Make Links Clickable (Ctrl+Left Click to Open)

1 participant