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
- Open a session in opencode
- Generate or display a very long URL that exceeds the terminal width
- The URL automatically wraps to the next line
- Hold Ctrl (or Cmd on macOS) and click on the wrapped URL
- 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:
- Detect when a URL spans multiple lines
- Concatenate the wrapped parts to form the complete URL
- 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.
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
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:
Possible Solutions
The terminal link detection logic should:
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.