mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-24 20:45:56 +03:00
[GH-ISSUE #744] Feature: Click count tracking + word/line selection primitives #973
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#973
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @phall1 on GitHub (Feb 26, 2026).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/744
Summary
The renderer's selection system currently operates at character-level granularity with coordinate-based APIs (
startSelection,updateSelection,getSelection). There's no built-in support for multi-click selection (double-click word, triple-click line) or text-coordinate mapping, which means consumers can't implement standard text selection UX without reverse-engineering internal layout math.Problem
MouseEventhas noclickCountproperty, and the renderer has no word/line-level selection methods. Implementing double-click-to-select-word requires:(x, y)→ text content → word/line boundaries → back to screen(x, y)to callstartSelection/updateSelectionStep 2 is the blocker. Text layout (wrapping, padding, scroll offsets) is internal to each renderable. There's no public API to go from a character index in text to a screen coordinate, so consumers end up either hardcoding layout assumptions or reaching into renderable internals — both fragile.
Requested APIs
1.
clickCountonMouseEventTrack consecutive clicks at the same position within a time threshold (~400ms). This is standard in every GUI framework (DOM, Qt, GTK, etc.).
2. Word/line selection on renderer
Methods that handle the text↔coordinate mapping internally, where the layout knowledge already lives:
The renderer already owns both the text layout and the selection state, so this is a natural extension of the existing selection system.
Use Case
Standard terminal text selection UX:
<box>persumably)@viralcodex commented on GitHub (Mar 5, 2026):
Hi @simonklee, would take it up on the weekend and contribute for this if needed, anything I should know before implementing? Please let me know 😄
@simonklee commented on GitHub (Mar 5, 2026):
Thanks for asking - i haven't looked at it, but let me try to get back at you. If i forget just ping me on discord or x :)
@viralcodex commented on GitHub (Mar 5, 2026):
@simonklee, will ping you on X by Friday night if it is fine.
@viralcodex commented on GitHub (Mar 9, 2026):
@simonklee , pinged you but I think you didn't see my message.