Text Selection in Dialog Captures Background Content in iTerm2
Description
GitHub Issue: Text Selection in Dialog Captures Background Content in iTerm2
Title
Text selection in authorization dialog includes content outside dialog boundaries when using Cmd+Click or drag selection in iTerm2
Description
When using opencode in iTerm2, the OAuth authorization dialog has text selection issues that make it difficult to copy the authorization URL.
Environment
- Terminal: iTerm2
- Application: opencode (TUI)
Problem
The authorization dialog displays a URL that needs to be copied, but text selection behaves incorrectly:
- Cmd+Click selection: Only selects text from the clicked line, missing the full URL
- Drag selection: Selects text outside the dialog boundaries, capturing background terminal content
Expected Behavior
- Text selection should be constrained to the dialog content only
- Users should be able to easily select and copy the complete authorization URL
Example of incorrectly selected text:
https://claude.ai/oauth/authorize?
code=true&client_id=9d1c250a-e61b-44d9-88ed-
5944d1962f5e&response_type=code&redirect_uri=https%3A%2F
%2Fconsole.anthropic.com%2Foauth%2Fcode%2Fcallback&scope
=org%3Acreate_api_key+user%3Aprofile+user%3Ainference&co
de_challenge=2Wy5LVaiONMHHw2yuf-CXveSoVvugkKnlzwdz4x9W88
&code_challenge_method=S256&state=uzVmwAC-e4nIhjiPKnmgMj
┃ 2VLNhio_5Qi6b4pwdx4kd1ihj40bq0mobkkAh5ky_j53WdIhkPAr8brc
┃ Ask a A1qzwz3Q
Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
This issue might be a duplicate of existing issues. Please check:
- #6209: Cannot scroll on opencode when using iterm - Also iTerm2 specific issue with mouse interaction and terminal rendering
- #6538: Mouse scrolling and selecting on dialog-command.tsx (ctrl+p) is broken only when is no session opened - Related to hit-grid calculation issues affecting mouse selection in dialogs
- #6923: Cli display has issues in the macOS built-in terminal - Related to terminal display rendering issues on macOS terminals
- #6912: Ctrl+C does not disable mouse tracking, causing raw escape sequences to flood terminal - Related to mouse tracking state management in terminal
Feel free to ignore if none of these address your specific case.
That looks like terminal native selection. Are you selecting with a modifier like shift when drag selecting?