[PR #6285] feat(tui): add double-click to copy word #11814

Open
opened 2026-02-16 18:16:45 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6285

State: open
Merged: No


Summary

Double-click on a word to copy it to clipboard, using the same selection mechanism as drag-to-copy.

Changes

  • Detect double-clicks by tracking click time/position (400ms threshold)
  • Find word boundaries by scanning the render buffer for word characters
  • Create selection using existing startSelection/updateSelection APIs
  • Existing onMouseUp handler automatically copies to clipboard with toast notification

Behavior

  • Works anywhere drag-to-copy selection works
  • Word characters: letters, digits, underscore, hyphen (unicode-aware)
  • Respects OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT flag

https://github.com/user-attachments/assets/945ce58d-ec9d-4135-b556-896fccfe01b8

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6285 **State:** open **Merged:** No --- ## Summary Double-click on a word to copy it to clipboard, using the same selection mechanism as drag-to-copy. ## Changes - Detect double-clicks by tracking click time/position (400ms threshold) - Find word boundaries by scanning the render buffer for word characters - Create selection using existing `startSelection`/`updateSelection` APIs - Existing `onMouseUp` handler automatically copies to clipboard with toast notification ## Behavior - Works anywhere drag-to-copy selection works - Word characters: letters, digits, underscore, hyphen (unicode-aware) - Respects `OPENCODE_EXPERIMENTAL_DISABLE_COPY_ON_SELECT` flag https://github.com/user-attachments/assets/945ce58d-ec9d-4135-b556-896fccfe01b8
yindo added the pull-request label 2026-02-16 18:16:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11814