Skip to content

Fix terminal copy/select and mobile scroll#40

Merged
selfcontained merged 5 commits into
mainfrom
fix/terminal-copy-and-mobile-scroll
Mar 11, 2026
Merged

Fix terminal copy/select and mobile scroll#40
selfcontained merged 5 commits into
mainfrom
fix/terminal-copy-and-mobile-scroll

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Upgrade xterm v5 → @xterm/xterm v6 with @xterm/addon-clipboard for proper clipboard integration
  • Fix selection clearing on mouseup — intercept mousedown on .xterm-screen and re-dispatch with shift+alt to force local selection mode instead of forwarding mouse events to tmux
  • Add mobile touch scrolling — convert finger drags into synthetic WheelEvents since xterm sets touch-action: none
  • Enable mobile long-press text selection — activate screenReaderMode on touch devices and allow pointer-events on the accessibility text layer
  • Disable pull-to-refreshoverscroll-behavior: none on html/body

Trade-offs

  • Desktop: mouse clicks in the terminal always trigger text selection instead of being forwarded to tmux mouse mode (TUI apps like htop). Acceptable since the terminal is primarily used to watch agent output.
  • Mobile: screenReaderMode is enabled on touch devices to render the accessibility text layer for long-press selection. Minimal performance impact.

Test plan

  • Desktop: select text in terminal, release mouse — selection persists
  • Desktop: Cmd+C copies selected text
  • Mobile: swipe up/down scrolls terminal output
  • Mobile: long-press on text triggers native selection UI
  • Mobile: pull-down no longer triggers refresh
  • Type check passes (npm run check)
  • Production build succeeds

🤖 Generated with Claude Code

Brad Harris and others added 5 commits March 11, 2026 11:01
Upgrade xterm v5 to @xterm/xterm v6 with ClipboardAddon to enable
proper clipboard integration. Intercept mousedown on .xterm-screen to
force local selection mode instead of forwarding mouse events to tmux
(which was causing selection to clear on mouseup). Add touch-to-wheel
conversion for mobile terminal scrolling and disable pull-to-refresh
overscroll on html/body.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Enable screenReaderMode on touch devices so xterm renders its
accessibility text layer, then allow pointer-events on that layer
via CSS media query. This lets native long-press selection work
on mobile. Also add overscroll-behavior:none to prevent
pull-to-refresh.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Redesign mobile terminal toolbar: two-row centered layout with
  Ctrl toggle modifier, action keys, keyboard input modal, and arrow keys
- Make Ctrl a toggle button that applies modifier to next keystroke
- Remove media status icon from footer
- Center footer status icons with justify-around
- Hide status text labels (OK, CONNECTED, etc.) on mobile

Co-Authored-By: Claude Opus 4.6 <[email protected]>
When connected to an agent session, display the agent's latest event
message (e.g. "Working on feature X") in the header instead of the
generic "Connected to session <name>" text. Falls back to the
original text if no event message is available.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@selfcontained
selfcontained merged commit 3b1024d into main Mar 11, 2026
1 check passed
@selfcontained
selfcontained deleted the fix/terminal-copy-and-mobile-scroll branch March 11, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant