Text Selection in Dialog Captures Background Content in iTerm2 #4261

Closed
opened 2026-02-16 17:43:12 -05:00 by yindo · 2 comments
Owner

Originally created by @boojongmin on GitHub (Jan 5, 2026).

Originally assigned to: @kommander on GitHub.

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:

  1. Cmd+Click selection: Only selects text from the clicked line, missing the full URL
  2. 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
Image

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

Originally created by @boojongmin on GitHub (Jan 5, 2026). Originally assigned to: @kommander on GitHub. ### 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: 1. **Cmd+Click selection**: Only selects text from the clicked line, missing the full URL 2. **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 ``` <img width="564" height="448" alt="Image" src="https://github.com/user-attachments/assets/d63ca1e7-12af-45a7-a153-7dff02018e5d" /> ### 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_
yindo added the opentuibug labels 2026-02-16 17:43:12 -05:00
yindo closed this issue 2026-02-16 17:43:12 -05:00
Author
Owner

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

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.

@github-actions[bot] commented on GitHub (Jan 5, 2026): 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.
Author
Owner

@kommander commented on GitHub (Jan 5, 2026):

That looks like terminal native selection. Are you selecting with a modifier like shift when drag selecting?

@kommander commented on GitHub (Jan 5, 2026): That looks like terminal native selection. Are you selecting with a modifier like shift when drag selecting?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4261