Bug: Incomplete link navigation when URL is wrapped across multiple lines in terminal #4401

Open
opened 2026-02-16 17:43:41 -05:00 by yindo · 1 comment
Owner

Originally created by @Newbluecake on GitHub (Jan 7, 2026).

Originally assigned to: @kommander on GitHub.

Bug Description

When a URL is displayed in the terminal and wraps across multiple lines due to width constraints, clicking the link with Ctrl+Click (or Cmd+Click on macOS) only captures a partial URL, resulting in failed navigation.

Steps to Reproduce

  1. Open a session in opencode
  2. Generate or display a very long URL that exceeds the terminal width
  3. The URL automatically wraps to the next line
  4. Hold Ctrl (or Cmd on macOS) and click on the wrapped URL
  5. The browser attempts to open only a partial URL

Expected Behavior

The entire URL should be captured and opened in the browser, regardless of how many lines it wraps across.

Actual Behavior

Only the text on the clicked line (either before or after the wrap) is captured as the URL, resulting in an incomplete/malformed URL.

Environment

Please fill in:

  • OS: [e.g., macOS 14.0, Windows 11, Ubuntu 22.04]
  • opencode version: [e.g., 0.x.x]
  • Terminal: [e.g., iTerm2, Windows Terminal, GNOME Terminal]

Possible Solutions

The terminal link detection logic should:

  1. Detect when a URL spans multiple lines
  2. Concatenate the wrapped parts to form the complete URL
  3. Use the complete URL for navigation

This is a common issue in terminal applications that display hyperlinks, and requires proper handling of line-wrapped URLs in the hyperlink escape sequence parsing.

Originally created by @Newbluecake on GitHub (Jan 7, 2026). Originally assigned to: @kommander on GitHub. ## Bug Description When a URL is displayed in the terminal and wraps across multiple lines due to width constraints, clicking the link with Ctrl+Click (or Cmd+Click on macOS) only captures a partial URL, resulting in failed navigation. ## Steps to Reproduce 1. Open a session in opencode 2. Generate or display a very long URL that exceeds the terminal width 3. The URL automatically wraps to the next line 4. Hold Ctrl (or Cmd on macOS) and click on the wrapped URL 5. The browser attempts to open only a partial URL ## Expected Behavior The entire URL should be captured and opened in the browser, regardless of how many lines it wraps across. ## Actual Behavior Only the text on the clicked line (either before or after the wrap) is captured as the URL, resulting in an incomplete/malformed URL. ## Environment Please fill in: - OS: [e.g., macOS 14.0, Windows 11, Ubuntu 22.04] - opencode version: [e.g., 0.x.x] - Terminal: [e.g., iTerm2, Windows Terminal, GNOME Terminal] ## Possible Solutions The terminal link detection logic should: 1. Detect when a URL spans multiple lines 2. Concatenate the wrapped parts to form the complete URL 3. Use the complete URL for navigation This is a common issue in terminal applications that display hyperlinks, and requires proper handling of line-wrapped URLs in the hyperlink escape sequence parsing.
yindo added the opentui label 2026-02-16 17:43:41 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 7, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #6996: Text Selection in Dialog Captures Background Content in iTerm2

The #6996 issue describes a similar problem with wrapped URLs in terminal dialogs where text selection doesn't properly capture multi-line URLs in iTerm2. Your issue about Ctrl+Click link navigation on wrapped URLs appears to be the same root cause affecting link navigation instead of text selection.

Feel free to ignore if your specific case differs from those reported.

@github-actions[bot] commented on GitHub (Jan 7, 2026): This issue might be a duplicate of existing issues. Please check: - #6996: Text Selection in Dialog Captures Background Content in iTerm2 The #6996 issue describes a similar problem with wrapped URLs in terminal dialogs where text selection doesn't properly capture multi-line URLs in iTerm2. Your issue about Ctrl+Click link navigation on wrapped URLs appears to be the same root cause affecting link navigation instead of text selection. Feel free to ignore if your specific case differs from those reported.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4401