claude-code - 💡(How to fix) Fix URLs in TUI output not clickable when wrapping across lines in Warp terminal (missing OSC 8 hyperlink support) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54606Fetched 2026-04-30 06:41:03
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1cross-referenced ×1

When Claude Code's TUI renders a long URL that wraps across two or more lines, terminals that do per-line URL detection (notably Warp) only open the first-line fragment when Cmd+clicking. The same session works correctly in iTerm2.

Root Cause

Claude Code emits hard newlines (\n) in its output rather than letting the terminal soft-wrap. Terminals like iTerm2 are soft-wrap-aware in their URL hit-testing, so they join wrapped segments correctly. Warp's CLI-agent rendering path does URL detection per logical/formatted line, so it sees two separate strings instead of one URL.

Code Example

\e]8;;<url>\e\\ display text \e]8;;\e\\
RAW_BUFFERClick to expand / collapse

Description

When Claude Code's TUI renders a long URL that wraps across two or more lines, terminals that do per-line URL detection (notably Warp) only open the first-line fragment when Cmd+clicking. The same session works correctly in iTerm2.

Root cause

Claude Code emits hard newlines (\n) in its output rather than letting the terminal soft-wrap. Terminals like iTerm2 are soft-wrap-aware in their URL hit-testing, so they join wrapped segments correctly. Warp's CLI-agent rendering path does URL detection per logical/formatted line, so it sees two separate strings instead of one URL.

Steps to reproduce

  1. Open Claude Code CLI inside Warp terminal
  2. Ask Claude anything that produces a long URL in the response (e.g. ask for a GitHub link with query parameters)
  3. Cmd+click the URL — only the first-line portion opens in the browser

Expected behavior

The full URL opens regardless of how many lines it visually spans.

Actual behavior

URL is split at the line-wrap boundary; only the first fragment is opened.

Suggested fix

Wrap URLs in OSC 8 hyperlink escape sequences when outputting to a terminal:

\e]8;;<url>\e\\ display text \e]8;;\e\\

This attaches the full URL as metadata to the displayed text, so any OSC 8-aware terminal (Warp, iTerm2, kitty, foot, etc.) opens the correct URL regardless of visual line wrapping. It also improves accessibility and is the standard terminal hyperlink mechanism.

Environment

  • OS: macOS
  • Shell: zsh
  • Warp version: 0.2026.04.27.15.32.02
  • Claude Code: claude-sonnet-4-6

Related

extent analysis

TL;DR

Wrap URLs in OSC 8 hyperlink escape sequences to ensure correct URL handling across terminals.

Guidance

  • Identify areas in Claude Code where URLs are output to the terminal and modify the code to wrap these URLs in OSC 8 hyperlink escape sequences.
  • Verify that the terminal supports OSC 8 escape sequences; if not, consider using a different terminal or filing an issue with the terminal's developers.
  • Test the modified code with different terminals, including Warp and iTerm2, to ensure the fix works as expected.
  • Review the suggested fix format: \e]8;;<url>\e\\ display text \e]8;;\e\\ to understand how to properly wrap URLs.

Example

# Example of wrapping a URL in OSC 8 hyperlink escape sequences
url="https://example.com/long/url/that/wraps"
echo -e "\e]8;;$url\e\\$url\e]8;;\e\\"

Notes

This solution relies on terminal support for OSC 8 escape sequences. If a terminal does not support these sequences, an alternative solution may be needed.

Recommendation

Apply the workaround by wrapping URLs in OSC 8 hyperlink escape sequences, as this is a standardized method for handling hyperlinks in terminals and improves accessibility.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The full URL opens regardless of how many lines it visually spans.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix URLs in TUI output not clickable when wrapping across lines in Warp terminal (missing OSC 8 hyperlink support) [1 comments, 2 participants]