- Shipped
- 5 Septemba 2026, 05:56 UTC
- Author
- Kamo
- Commit
- 8c57755
for anything else. I built it against a bare xterm.js writing its own output and never against the real pipeline, which is the whole of the mistake. tmux is a screen DIFFER, not a pipe. When a command produces two hundred lines tmux sends the client only the twenty-four that end up visible and keeps the rest in its own history — the intermediate lines never reach the browser at all. So xterm's buffer cannot grow and `baseY` is always 0, which is exactly the condition the bar treats as "nothing to scroll". Measured rather than reasoned about: real PTY bytes were captured from this agent's own argv and replayed into a real xterm.js. baseY stayed 0 in every variant — with tmux's status line off (which removes the partial 1;23 scroll region) and with its alternate screen disabled via smcup@/rmcup@. The buffer ended at 24 lines each time while the last line of output was present, which is the signature of a differ rather than a stream. So the scrollback that exists is tmux's, and copy-mode is the only way in. tmux already binds `WheelUpPane` to `copy-mode -e` in its root table — it simply never receives a wheel event, because mouse mode is off. Turning it on makes the physical wheel scroll, and lets the console's scrollbar drive the same path by sending the same reports. `-e` means tmux leaves copy mode by itself once the member reaches the bottom, so there is no mode for anything to manage. Set at creation via tmux's own `;` command separator, which it honours inside an argv list, so there is no second call and no race with the session appearing. The ordering matters and a test now pins it: `-c` is an argument to new-session and must come BEFORE the separator. My first attempt appended the separator first, which would have made tmux read `-c` as an argument to set-option and Verified end to end through this agent's own TerminalSession: the session comes up with mouse on, four wheel-up reports of exactly the bytes the browser sends put the pane in copy mode at scroll_position 15, and a wheel-down burst returns it to the prompt. 228 tests.