Repository navigation
Terminals scroll under a finger on a phone, Claude Code's own view included - #311
Open
rivshughes wants to merge 1 commit into
Open
rivshughes wants to merge 1 commit into
rivshughes wants to merge 1 commit into
Conversation
…cluded On the 2D view a worker's terminal couldn't be scrolled by touch at all: xterm.js 6 ships touch-gesture code but never attaches it to its viewport, so a finger over the terminal did nothing, however slowly it moved. A drag over the terminal is now a mouse wheel: a notch per row of travel. When the program in the terminal tracks the mouse, as Claude Code does, each notch is handed to xterm as a wheel event, which it reports to the program the same way a real wheel is, and the program scrolls its own view; xterm's buffer has nothing to scroll in that mode. Otherwise the buffer scrolls. A tap, or a second finger, is left to the browser. Checked with an emulated iPhone: on a plain terminal with scrollback the viewport moves and returns; on a Claude Code worker a half-screen drag sends one wheel report per row, exactly what the same number of wheel notches sends. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
muguetdev
added a commit
to muguetdev/agent-office
that referenced
this pull request
Oct 9, 2026
…roll Terminals scroll under a finger on a phone (from Agent Office AgentSystemLabs#311)
muguetdev
added a commit
to muguetdev/agent-office
that referenced
this pull request
Oct 9, 2026
…roll Terminals scroll under a finger on a phone (from Agent Office AgentSystemLabs#311)
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.
What
On the 2D view (
/lite) a worker's terminal can't be scrolled by touch: dragging a finger over it does nothing, slow or fast, in Safari and Chrome on iOS alike.Two things combine:
ESC[<64;col;rowM) and Claude Code scrolls its own view. Its buffer has nothing to scroll in that mode, so scrolling xterm itself wouldn't have helped anyway.How
touchScrollinsrc/client/ui/terminal.ts: a drag over the terminal is a mouse wheel, a notch per row of travel.term.modes.mouseTrackingModeisn'tnone, each notch is dispatched to xterm as awheelevent (DOM_DELTA_LINE, ±1), which xterm turns into exactly the report a real wheel notch produces, so the program scrolls its view.term.scrollLines(notches)scrolls the buffer, as for a shell.touchmoveis claimed withpreventDefaultso the 2D page doesn't scroll under the terminal; a tap and a second finger (zoom) are left to the browser.Docs: a sentence in
docs/controls.md(phone paragraph) anddocs/features.md(the 2D view bullet).Checks
npm run typecheck,npm test(606 passing),npm run build.ESC[<64;…Mwheel-up reports over the WebSocket, one per row, where before it sent nothing.🤖 Generated with Claude Code