Repository navigation
fix(terminal): replay a busy pane's mouse mode to late joiners - #31
Merged
Merged
Conversation
A client joining a live attachment got only the last 256 KiB of the stream. herdr turns on the alternate screen and mouse reporting once, at the start of that stream, so on a busy pane the joiner (a phone opening a pane a desktop tab holds) ran with mouse reporting off. xterm then turns a wheel, and our touch drag, into arrow keys, which paged through the agent's prompt history instead of scrolling herdr. The replay now leads with every private mode switched by output that fell out of the tail, in the order of their last switches, and never cuts a control sequence in two. xterm also drops a wheel while reporting is off instead of typing arrows. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
devswha
force-pushed
the
fix/late-join-terminal-modes
branch
from
September 24, 2026 21:52
fe9160c to
d56fb59
Compare
3 tasks done
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
On a phone, dragging the terminal of a Claude Code pane still paged through the prompt history instead of scrolling. This happened even after #28.
Cause: a client joining a live attachment only gets the last 256 KiB of the stream (
replay).herdr terminal attachturns on the alternate screen and mouse reporting once, at the start of the stream. On a busy pane, such as an agent that keeps redrawing, those switches fall out of the tail. A late joiner therefore runs with mouse reporting off. A typical late joiner is a phone opening a pane that a desktop tab already holds. Withscrollback: 0, xterm turns a wheel, including our touch drag, intoESC [ A/ESC [ B. That is Up/Down, the prompt history.Fix:
ReplayBuffer(server/output-window.ts) replacesreplayTail.1016lafter1006hresets xterm's mouse encoding.attachCustomWheelEventHandler). herdr always turns reporting on, so this is only a guard. It also covers remote PCs until their bridge picks this up in a future bundle.Testing
ESC[Aand no mouse reports.?1049h … ?1000h ?1002h ?1003h ?1015h ?1006h, and the drag sends SGR wheel reports (ESC[<64;col;rowM) at the finger's cell.ReplayBuffer.bun run typecheckpasses,bun testpasses 302/302, andbun run test:uipasses.🤖 Generated with Claude Code