2
0
Fork 0

feat: select and copy text on touch terminals #37

Merged
aleksei merged 1 commit from feat/mobile-text-selection into main 2026-11-12 19:04:04 +00:00
Owner

Summary

  • xterm renders its text to a canvas, so the browser has no native selectable text. A long press on the terminal now selects the word under the finger through Terminal.select.
  • Dragging extends the selection across rows, while a movement of more than 10 px before the timer fires remains a normal scroll gesture.
  • A floating Copy/Cancel bar copies the selection with the Clipboard API and falls back to execCommand("copy") on older Safari.
  • The platform context menu is suppressed on coarse pointers while the portal owns the touch selection.
  • README and the terminal/UI ADRs document the new gesture.

Test plan

  • npm run typecheck
  • npm run build
  • Manual mobile Playwright check: long press selects a word, drag extends it, Copy puts the selected text in the clipboard.
## Summary - xterm renders its text to a canvas, so the browser has no native selectable text. A long press on the terminal now selects the word under the finger through `Terminal.select`. - Dragging extends the selection across rows, while a movement of more than 10 px before the timer fires remains a normal scroll gesture. - A floating Copy/Cancel bar copies the selection with the Clipboard API and falls back to `execCommand("copy")` on older Safari. - The platform context menu is suppressed on coarse pointers while the portal owns the touch selection. - README and the terminal/UI ADRs document the new gesture. ## Test plan - `npm run typecheck` - `npm run build` - Manual mobile Playwright check: long press selects a word, drag extends it, Copy puts the selected text in the clipboard.
A long press selects the word under the finger because xterm renders to a canvas and the browser has no native selectable text. Dragging extends the selection across rows and a floating Copy/Cancel bar copies it with the Clipboard API. The swipe-to-wheel path stands down while the gesture is a selection.
aleksei deleted branch feat/mobile-text-selection 2026-11-12 19:04:04 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zoo/mux-portal!37
No description provided.