Skip to content

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

@Newbluecake

Description

@Newbluecake

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.

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions