fix(pi): leave page keys out, and pin the strip that makes the wheel work

transcriptPageKeys applied to every pi, and a pi in `tuiMode: regular` binds
PageUp/PageDown to its editor. It emits no mouse enable, so the flag stays
false, and on a fresh pane the buffer is hollow: the wheel sent PageUp, the
caret of a multi-line draft moved, and the next keystroke landed on the wrong
line. Measured on real pi 1.1.0, 1.4.0 and 1.5.0. Regular mode is not exotic,
it only takes one line in pi's settings. Telling the two modes apart would
need a new capability, since the paging gate takes no id, so pi has no
fallback: a fullscreen pi with "Wheel scrolls local history" on stays where
master left it.

altScreen, the half of the fix that does the work, was pinned by nothing:
reverting it left 1328 tests green. The strip decision table reads its
expected value from the same registry entry. pi now has its own block using
the bytes it really emits, which also pins that focus reporting survives.

The fullscreen default dates from pi 1.0.0, not 1.4.0, so the comments say
that, and the sites still calling pi narrow-strip or main-screen by default
are corrected. Where a comment listed CLIs it now names the capability.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-11-06 01:04:01 +01:00
1 parent 58dae1e182
commit b5aa3fbdf7
14 files changed
+102 -40

No files matched your search

+5 -5
View File
@@ -304,8 +304,8 @@ function cliExportsTruecolor(mode: SessionMode): boolean {
* Codex, Claude Code, and Gemini are known, controlled (Ink/React) TUIs that
* repaint via cursor positioning, so dropping the alt-screen switch is safe —
* content stays in the normal buffer. Excluded: `shell` (arbitrary programs like
* vim/less/htop legitimately need the alt screen), `opencode` and `pi` (their own MIDDLE strip,
* isMuxMouseStripMode; pi since 1.4.0) and `grok` (a fullscreen alt-screen TUI with
* vim/less/htop legitimately need the alt screen), `opencode`, `copilot` and `pi` (their own
* MIDDLE strip, isMuxMouseStripMode) and `grok` (a fullscreen alt-screen TUI with
* mouse support). Keep parity with the replay-side strip (`stripReplayBuffer` in
* session-routes.ts); the table in `CliCapabilities.altScreen` is pinned for every
* stock CLI in test/claude-scrollback-strip.test.ts.
@@ -315,8 +315,8 @@ function cliExportsTruecolor(mode: SessionMode): boolean {
* strip the alt-screen toggles too whenever the session is tmux-backed, and
* pi/opencode ALWAYS are (both refuse the direct-PTY fallback). What exclusion
* actually buys is the rest of the full strip: `\x1b[3J` survives, and for the
* narrow strip the mouse-tracking DECSETs too. pi (1.4.0, measured) is a
* mouse-aware fullscreen TUI like opencode and copilot, so it takes the mouse
* narrow strip the mouse-tracking DECSETs too. pi (fullscreen by default since
* 1.0.0) is a mouse-aware TUI like opencode and copilot, so it takes the mouse
* strip (isMuxMouseStripMode): a drag selects locally and `cliMouseTracking`
* keeps the wheel working across a buffer replay.
*/
@@ -3001,7 +3001,7 @@ export class Session extends EventEmitter {
// redraws overwrite only the cells they target, so non-erased rows keep
// their content. Gated to Codex/Claude/Gemini (isAltScreenStripMode).
//
// Every OTHER mode (shell/antigravity/pi/grok/deepseek/omp) gets the NARROW strip
// Every OTHER mode (shell/antigravity/grok/deepseek/omp) gets the NARROW strip
// when it is tmux-backed: alt-screen toggles only, because the sequence that breaks
// scrollback there is tmux's own client-side smcup at attach, not anything the
// program in the pane emitted (issue #205, see isMuxAltScreenOnlyStripMode).