feat(tui): add double-click to copy word#6285
Open
ndraiman wants to merge 3 commits intoanomalyco:devfrom
Open
feat(tui): add double-click to copy word#6285ndraiman wants to merge 3 commits intoanomalyco:devfrom
ndraiman wants to merge 3 commits intoanomalyco:devfrom
Conversation
Implement double-click detection and word boundary finding in the terminal UI to enable selecting entire words with a double-click gesture. This feature respects the experimental flag for copy-on-select functionality and integrates with the existing selection APIs. The implementation includes: - Double-click detection based on timing and position thresholds - Word boundary detection using character code analysis - Integration with renderer's startSelection and updateSelection methods - Proper state management to prevent triple-clicks being misdetected
Refactored the double-click detection and word selection implementation to be more concise and maintainable. Consolidated multiple state variables into a single click object, inlined helper functions, and simplified the word boundary detection logic while preserving functionality.
The row offset calculation (evt.y * width) was being computed multiple times in the double-click word selection logic. Extract it to a variable to improve readability and avoid redundant calculations.
99fd358 to
46fd22c
Compare
This was referenced Jan 14, 2026
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
Contributor
|
@ndraiman How hard would it be to add triple-click to select by line? Double-click for word and triple-click for line are two missing behaviors that drive me crazy on a daily basis, would be great to add support for both! |
1 task
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Double-click on a word to copy it to clipboard, using the same selection mechanism as drag-to-copy.
Changes
startSelection/updateSelectionAPIsonMouseUphandler automatically copies to clipboard with toast notificationBehavior
OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECTflagScreen.Recording.2025-12-28.at.10.39.20.mov