Conversation
…om the first wheel event Two changes to the last-resort page-key scroll (_maybePageCliTranscript), the path a wheel or touch gesture takes when it is not forwarded to the CLI and the local xterm buffer has no history (normal buffer, baseY 0). Codex now takes that path too. Newer codex draws on tmux's alternate screen, which the full strip hides from xterm, so a codex pane is as hollow as a repaint-mode Claude pane and the wheel did nothing. Codex still ignores SGR wheel reports and is still never forwarded the wheel; this sends plain PageUp/PageDown keys, which codex does page its transcript on (measured on 0.157.1 locally and 0.160 over a remote session). Which modes may page is a new registry capability, capabilities.transcriptPageKeys (claude and codex in stock.ts), published to the page as window.__codemanTranscriptPageKeys, so terminal-ui.js holds no CLI id for it. The first event of a gesture now pages at once. The fallback used to send a key only after half a screen of accumulated travel (19 rows, about 475px on a 38-row pane), so an ordinary trackpad flick sent nothing. The skipped travel is owed back by the rest of the gesture, keeping one page per half screen; a pause of more than 150 ms, a direction change or a tab switch starts a new gesture.
Contributor
Author
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.
This changes the last-resort page-key scroll in
_maybePageCliTranscript. That path runs when a wheel or touch gesture is not forwarded to the CLI and the local xterm buffer holds no history (normal buffer,baseY === 0). It sends plain PageUp/PageDown keys so the CLI pages its own transcript.This is not SGR wheel forwarding. Codex still ignores SGR wheel reports (#227), its
wheelForwardstaysnever, and_shouldForwardWheelToAppis unchanged.Codex can use the page-key fallback. Newer Codex draws on tmux's alternate screen, and the full strip hides that from xterm, so a Codex pane has no local scrollback, just like a repaint-mode Claude pane. Scrolling the wheel over it did nothing.
baseY > 0), so the guard never fires for it.capabilities.transcriptPageKeys(set for claude and codex instock.ts, an optional boolean in the schema).window.__codemanTranscriptPageKeys, also in/session/:idwindows, soterminal-ui.jsholds no CLI id for it. The oldmode !== 'claude'check is gone.The first event of a gesture pages straight away. The fallback used to send a key only after half a screen of accumulated travel (19 rows, about 475 px on a 38-row pane), so an ordinary trackpad flick sent nothing.
Tests. These fail on master and pass with this change:
test/terminal-scroll-routing.test.ts: Codex pages only while hollow; first-event paging and repayment; gesture reset; tab isolation; modes come only from the injected map.test/cli-registry-schema.test.ts: the capability's shape, and exactly claude and codex set in stock.test/render-index-html.test.ts: injection in the main page and the solo window.docs/architecture-invariants.mdis updated.One trade-off: small gestures now send a key where they used to send nothing, for Claude as well. A Claude menu or dialog open at that moment could react to PageUp, which is the caveat this fallback already carries.