Support OSC 8 hyperlink sequences for file paths and URLs in TUI output

Status Closed — not planned
Maintainer reply None cached
Activity 2 comments · opened Apr 15, 2026 · closed May 27, 2026

Problem

Claude Code outputs absolute file paths and URLs in its TUI, but they're not clickable. Modern terminals (Ghostty, iTerm2, WezTerm, Kitty) support OSC 8 hyperlink escape sequences — inline clickable links embedded directly in terminal output.

Since Claude Code's TUI captures all mouse events, the terminal's native URL detection (hover + Cmd/Ctrl) can't work. OSC 8 is the standard way TUI apps solve this — the terminal recognizes the escape sequence regardless of alternate screen buffer or mouse capture mode.

Expected behavior

File paths like /Users/me/project/src/app.ts:42 and URLs like https://github.com/org/repo/pull/1 in Claude Code output should be Cmd+clickable (macOS) / Ctrl+clickable (Linux) to open in the default editor or browser.

Proposed solution

Wrap file paths and URLs in OSC 8 sequences:

\e]8;;file:///Users/me/project/src/app.ts\e\\path/to/file.ts:42\e]8;;\e\\
\e]8;;https://github.com/org/repo/pull/1\e\\PR #1\e]8;;\e\\

This is already the approach used by tools like ls --hyperlink, gcc, and systemd for terminal-native link support.

Context

  • Claude Code already outputs absolute paths (configurable in CLAUDE.md) specifically to enable terminal click-to-open
  • The PR status footer already has a clickable link — extending this to all paths/URLs would be consistent
  • Terminals that don't support OSC 8 simply ignore the sequences — zero visual impact on older terminals

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗