feat(tui): add double/triple click copy selection#17465
Conversation
- Added selection utility functions to manage text selection in the TUI. - Integrated selection checks in various components to prevent actions when text is selected. - Updated dialog components to handle selection state during user interactions. - Enhanced mouse event handling to support double and triple click selections. - Added tests for selection behavior, including single, double, and triple click scenarios.
|
The following comment was made by an LLM, it may be inaccurate: I found several potentially related PRs:
The most directly related PR is #6285 which appears to implement very similar double-click selection/copy functionality for words. You may want to check if that PR was already merged or if there's overlap with the current implementation. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #3091
Closes #7336
Type of change
What does this PR do?
This adds mouse word/line copy support to the TUI.
The selection is computed from the rendered terminal buffer, so it matches what the user actually sees, including concealed markdown/code and wide characters.
Existing drag-copy and right-click copy behavior stays the same. Clickable TUI elements also skip their normal action while a text selection is active.
How did you verify your code works?
I ran:
bun test test/cli/tuibun typecheckI also added TUI tests for:
Screenshots / recordings
bun devChecklist
If you do not follow this template your PR will be automatically rejected.