Conversation
|
Thanks for this, @aakhter, and sorry it sat while the rail stack went in. This extends the hollow-pane PageUp/PageDown fallback to Codex through a new I ran this PR's
Each one is a few lines in One thing I couldn't check here: the installed Codex is 0.147.0, so I couldn't reproduce the alt-screen Codex you measured on 0.157.1 and 0.160. If you know which Codex version started drawing on the alt screen, a line about it in the invariants paragraph would help whoever reads it next. #525 and #526 just shipped in 1.35.0, so this is next in line, and it still merges cleanly onto master. |
…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.
…el notches and dialogs Review follow-up for the hollow-pane PageUp/PageDown fallback (_maybePageCliTranscript): - A mostly horizontal wheel swipe (both deltas present, |deltaX| > |deltaY|) is consumed without paging. The touch path already locks its axis. - A pinch (wheel events with ctrlKey, as Chrome reports one) is consumed without paging. - Only a trackpad-sized opening event (under 2 rows) pages at once. A wheel notch (100 px, 4 rows) accumulates toward half a screen as before, so five slow notches send one PageUp again instead of five. A debt from a pre-paid page still dies with its gesture; plain wheel travel carries across notches. - Nothing pages while the active tab's alert is 'action' (a pending permission_prompt or elicitation_dialog), so a page key never reaches an open dialog's selector. Docs: the invariants paragraph now says which Codex versions were seen drawing on the alt screen (0.157.1, 0.160) and that 0.147.0 still draws inline, without claiming a cutoff.
|
Thanks for running it side by side with master; that made each of these easy to reproduce. All four are in a new commit on top (8d6e578), rebased onto 1.35.0, each with its own case in
Codex version. I can't pin down when Codex started drawing on the alt screen. It was seen on 0.157.1 locally and on 0.160 over a remote session, and your 0.147.0 draws inline. Nothing in between has been checked, so the invariants paragraph now says exactly that, without naming a cutoff. Each new case fails without its guard. Typecheck, lint, format, the frontend checks, the catalogue check and the touched test files all pass. It's still a draft only because GitHub won't let my account mark PRs ready; it's ready for review. |
17fb7f8 to
8d6e578
Compare
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.