feat(terminal): touch scroll, copy mode toggle, and desktop mouse fix#5
Open
dguerizec wants to merge 2 commits intotwidi:mainfrom
Open
feat(terminal): touch scroll, copy mode toggle, and desktop mouse fix#5dguerizec wants to merge 2 commits intotwidi:mainfrom
dguerizec wants to merge 2 commits intotwidi:mainfrom
Conversation
Mobile toolbar gets a Copy toggle button (off by default):
- Off (scroll mode): swipe scrolls the terminal with natural direction
- On (copy mode): swipe selects text, auto-resets after copy
Scroll adapts to context via tmux pane state detection:
- Shell prompt: SGR mouse wheel → tmux copy-mode scrollback
- Alternate screen (less, vim): arrow keys → app handles scroll
- Raw shell (no tmux): xterm.js viewport scrollLines()
Backend polls tmux #{alternate_on} every 2s, sends state to frontend
so scroll method switches automatically. Also enables tmux mouse mode
for proper wheel event handling and configures smart WheelUpPane /
WheelDownPane bindings.
…aste In tmux mode, SGR mouse tracking causes xterm.js to send all mouse events as escape sequences to tmux instead of handling them locally. This breaks text selection and paste on desktop. A capture-phase mousedown listener on the terminal container blocks all mouse buttons from reaching xterm.js. Left-button gets preventDefault for custom drag selection via terminal.select(). Middle/right-click only get stopPropagation so browser default actions (X11 paste, context menu) flow through to xterm.js's native paste handler. Also removes ClipboardAddon so Ctrl+V reaches the shell (quoted-insert) instead of being intercepted for clipboard paste.
7 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
#{alternate_on}every 2s and pushes pane state to frontendSplit from #4 as requested — scroll & mouse interaction only, no navigator/presets/window management.
Test plan
less→ swipe sends arrow keys (content scrolls)🤖 Generated with Claude Code