OSC 8 hyperlink span extends past link text, breaking clickability

Resolved 💬 1 comment Opened May 22, 2026 by ventilla Closed Jun 22, 2026

Description

When Claude Code renders file paths as clickable links in terminal output, the OSC 8 hyperlink region sometimes extends beyond the actual link text to the right edge of the terminal. When this happens, Cmd+click fails to open the file.

Reproduction

  1. Have an agent output a file path near the end of a line (e.g. Plan complete and saved to ~/path/to/file.md.)
  2. Hover over the link — observe the underline extends past the text as a white/different-colored line continuing to the right margin
  3. Cmd+click does nothing

Expected behavior

The hyperlink span should tightly wrap the path text. When it does, Cmd+click correctly opens the file in the configured editor (e.g. Cursor).

What works vs. what doesn't

  • Works: Links that are followed by more text on the same line, or where the span is properly bounded
  • Broken: Links near the end of a line where the span bleeds into trailing whitespace/padding

Screenshot

The purple underline under the path text is visible, plus a white line extending past the text to the right edge — showing the hyperlink region is too wide:

Path in question: ~/sensorium/docs/plans/2026-05-22-visual-verification-plan.md

Environment

  • macOS (Darwin 25.4.0)
  • Claude Code CLI
  • Terminal: macOS terminal app
  • Model: Opus 4.6 (1M context)

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗