fix: page keys scroll pane scrollback at zsh and REPL prompts - #2191
Conversation
PageUp/PageDown were forwarded to the pane whenever DECCKM (application cursor) was on, assuming only primary-screen pagers enable it, but zsh's line editor also enables DECCKM, as do REPLs such as python3. The result was PageUp scrolling shell history instead of Herdr scrollback. Bracketed paste discriminates the two: it means the app accepts typed or pasted text at a prompt, so line editors enable it and pagers do not.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe change allows PageUp to scroll host pane history when DECCKM and bracketed paste are active. Regression tests verify local key consumption, scrollback movement, and no shell or PTY input. ChangesPageUp host scrollback
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant TerminalInput
participant InputState
participant HostScrollback
participant ShellOrPTY
TerminalInput->>InputState: Process PageUp with DECCKM and bracketed paste enabled
InputState->>HostScrollback: Consume PageUp and advance pane scrollback
InputState--xShellOrPTY: Do not forward PageUp bytes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR refines plain PageUp/PageDown routing so zsh and REPL prompts using both application-cursor and bracketed-paste modes use Herdr scrollback while primary-screen pagers continue receiving page keys.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/pane/terminal.rs | Refines the shared page-key routing predicate to recognize shell-like DECCKM sessions through bracketed-paste mode and adds direct predicate coverage. |
| src/app/input/terminal.rs | Adds an application-level test confirming PageUp scrolls the host pane rather than reaching a zsh-like prompt. |
| src/server/headless.rs | Adds equivalent headless terminal-attach coverage for the revised page-key routing behavior. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
K[Plain PageUp or PageDown] --> A{Alternate screen or mouse reporting?}
A -- Yes --> P[Forward key to pane]
A -- No --> C{Application cursor enabled?}
C -- No --> H[Use Herdr scrollback]
C -- Yes --> B{Bracketed paste enabled?}
B -- Yes --> H
B -- No --> P
Reviews (3): Last reviewed commit: "test: update page key state fixture" | Re-trigger Greptile
|
ty! |
PageUp/PageDown were forwarded to the pane whenever DECCKM (application cursor) was on, assuming only primary-screen pagers enable it, but zsh's line editor also enables DECCKM, as do REPLs such as python3. The result was PageUp scrolling shell history instead of Herdr scrollback.
Bracketed paste discriminates the two: it means the app accepts typed or pasted text at a prompt, so line editors enable it and pagers do not.
Related: #953