fix(desktop): wheel-scroll codex transcripts via terminal scrollback#2499
Open
aprv10 wants to merge 3 commits into
Open
fix(desktop): wheel-scroll codex transcripts via terminal scrollback#2499aprv10 wants to merge 3 commits into
aprv10 wants to merge 3 commits into
Conversation
illegalcall
reviewed
Jul 8, 2026
illegalcall
left a comment
Collaborator
There was a problem hiding this comment.
The new wheel-routing branch means Windows mouse-tracking panes now receive SGR wheel reports unless paneScrollsByKeyboard is true. TerminalPane only sets that hint for opencode, but kilocode is also a supported provider and the backend documents it as an OpenCode fork that shares the same TUI surface. This likely regresses Kilo Code wheel scrolling on Windows compared with the previous PageUp/PageDown fallback. Please add kilocode to KEYBOARD_SCROLL_PROVIDERS and cover that provider wiring.
Contributor
Author
|
Added kilocode to KEYBOARD_SCROLL_PROVIDERS, and extracted the mapping into providerScrollsByKeyboard() with a test covering both opencode and kilocode so the wiring can't silently regress again. Thanks! |
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.
Resolves #2493
What
Mouse wheel (and PageUp/PageDown) did nothing when scrolling a codex pane on Windows. This makes the wheel scroll codex's transcript, the same way it already works in a raw terminal — without regressing the opencode scroll fix.
Root cause
The terminal was built on the assumption that every pane is a full-screen alt-buffer app under tmux (macOS/Linux): it set
scrollback: 0and synthesized SGR mouse reports so tmux copy-mode does the scrolling. The recent opencode fix layered on a blanketisWindowsPlatform()rule that force-fed PageUp/PageDown to every Windows pane.Codex breaks all of those assumptions. Probing
term.buffer/term.modeswhile wheel-scrolling a live codex session showed:buf=normal— codex is a normal-buffer app, not alt-screenmode=none— it does not track the mouse (SGR reports are ignored)len == rows,baseY ≈ 0even after a long chatCodex just prints its transcript and relies on the terminal's own scrollback (exactly what you see in raw PowerShell). But
scrollback: 0discarded every line that scrolled off, so there was nothing to scroll.Fix
scrollback: 0 → 5000so normal-buffer panes retain history. Alt-buffer panes (tmux, mouse-tracking TUIs) never feed this buffer, so they're unaffected.paneScrollsByKeyboard→ PageUp/PageDown (opencode — unchanged, kept first); (2) mouse-off + normal buffer →term.scrollLines()native scroll (codex, new); (3) mouse tracking on → SGR reports (tmux/zellij copy-mode); (4) alt-buffer fallback → page keys.isWindowsPlatform()branch; opencode is already covered by rule 1 on every platform..xterm-viewportscrollbar so the new scrollback doesn't reserve width and shift the grid; dropped the now-dead scrollbar-thumb CSS.Testing
XtermTerminal.test.tsx— added codex native-scroll and alt-buffer fallback cases; 31/31 pass,tsc --noEmitclean.