Long URLs break when ctrl-clicked or copied in terminal due to line wrapping
Resolved 💬 3 comments Opened May 27, 2026 by Kevofehr Closed May 30, 2026
Problem
When Claude Code outputs long URLs in the terminal, they get line-wrapped based on the terminal width. This causes two issues:
- Ctrl-click to open the URL in a browser only captures the portion up to the line break, resulting in a truncated URL (404).
- Copy-paste of the URL includes line breaks and fragments, producing a broken URL.
This is especially common with product links, GitHub URLs, documentation links, etc. — anything longer than ~80 characters.
Expected behavior
URLs should be clickable and copyable regardless of terminal width. Possible solutions:
- Use OSC 8 hyperlink escape sequences to wrap URLs so terminals render them as clickable links with short display text
- Shorten the display text while keeping the full URL in the hyperlink metadata
- Detect terminal width and avoid breaking URLs mid-line (e.g., place them on their own line with no wrapping)
Environment
- Windows 11, PowerShell terminal
- Claude Code CLI
- Issue is terminal-agnostic (affects Windows Terminal, VS Code integrated terminal, etc.)
Reproduction
- Ask Claude Code a question that produces a long URL (e.g., a product link or documentation URL)
- Resize the terminal window so it's not full width
- Try to ctrl-click or copy the URL — it will be truncated or broken
🤖 Generated with Claude Code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗