fix(terminal): scroll output with Page Up/Down from prompt (#9008)#9624
Conversation
…v#9008) When the prompt editor is focused and suggestions/history menus are hidden, route Page Up/Page Down to terminal viewport paging instead of only moving within the multiline buffer. Preserve editor-local paging while suggestion UI is visible. Expose scroll-one-page actions as editable shortcuts (terminal:scroll_up_one_page, terminal:scroll_down_one_page) with default Page Up/Page Down triggers. Fixes warpdotdev#9008 Made-with: Cursor
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @fadexadex on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment |
|
I'm starting a first review of this pull request. I completed the review and posted feedback on this pull request. Comment I completed the review and posted feedback on this pull request. Comment I'm re-reviewing this pull request in response to a review request. I reviewed this pull request and requested human review from: @kevinyang372. Comment You can view the conversation on Warp. I completed the review and posted feedback on this pull request. Comment Powered by Oz |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
There was a problem hiding this comment.
Overview
This PR routes Page Up/Page Down from the terminal prompt into terminal scroll events when suggestion UI is closed and registers terminal page-scroll actions as editable bindings.
Concerns
- The prompt-focused path still enters through the editor's fixed Page Up/Page Down bindings, so user changes to the new editable terminal scroll shortcuts do not apply while the prompt is focused.
- Supplemental security pass found no security-specific issues.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| self.editor | ||
| .update(ctx, |input, ctx| input.move_page_up(ctx)); | ||
| } else { | ||
| ctx.emit(Event::PageUp); |
There was a problem hiding this comment.
pageup/pagedown bindings; clearing or rebinding the new terminal:scroll_*_one_page shortcuts won't affect prompt focus, so the shortcuts shown as editable are not actually editable in the primary path. Route prompt scrolling through the editable terminal action path, or make the editor binding context respect the terminal scroll binding, so user customizations apply.
- Exclude EditorFocused from terminal:scroll_* TerminalAction predicates so page keys dispatch through InputAction while the prompt editor is focused. - Add TERMINAL_INPUT_PAGE_KEYS_HANDLED_BY_INPUT and gate editor fixed pageup/pagedown so terminal Input owns those keys. - Register InputAction::PageUp/PageDown editable bindings (terminal:scroll_*) and wire typed-action dispatch to editor_page_up/down. - Add regression test for set_custom_trigger on terminal scroll while prompt focused. Addresses Oz feedback on editable shortcuts applying when typing in the prompt. Made-with: Cursor
4f0aba4 to
55423ec
Compare
There was a problem hiding this comment.
Overview
This PR routes Page Up/Down from terminal input through TerminalView scrolling and replaces fixed terminal paging bindings with editable entries.
Concerns
- The new editable scroll bindings are disabled while the prompt editor is focused, so the Page Up/Down behavior fixed by this PR remains controlled by the editor binding rather than the advertised terminal shortcut. No security issues were found in the changed code.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
@oz-agent review |
|
I'm working on changes requested in this PR (responding to a PR conversation comment). You can view the conversation on Warp. I pushed changes to this PR based on the comment. Next steps:
Powered by Oz |
There was a problem hiding this comment.
Overview
This PR reroutes Page Up/Page Down from the terminal prompt through terminal scrolling when no input suggestion/history UI is visible, exposes the page-scroll actions as editable keybindings, and adds regression coverage for prompt focus, visible suggestions, Vim mode, and custom bindings.
Concerns
- No blocking correctness or security concerns found in the changed lines.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
There was a problem hiding this comment.
Overview
This PR reroutes Page Up/Page Down from the focused terminal prompt through input/terminal scroll actions and registers editable scroll bindings.
Concerns
- The prompt editor context now suppresses its fixed Page Up/Page Down bindings unconditionally. When the new terminal scroll binding is inactive or when suggestions/history UI should remain editor-local, physical Page Up/Page Down can no longer fall back to the editor behavior.
- Security pass: no security concerns found in the changed code.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
I tried this locally and it works, which is cool. On my mac, fn up/down is how you do page up/down, but it also activates voice mode. not sure how we should handle this conflict |
|
Yeah I use a voice tool too (Wispr), and noticed something similar, maybe people can reassign their trigger button for the voice tool, or I try to find an intuitive way for Mac users to scroll without the fn button, but they'd have to go through the docs to figure it out which might not be a good experience. |
|
FWIW I think it's probably fine to not worry about this edge case to start. If the code looks good I'm cool with merging this. Thank you for the contribution! |
|
Also, @fadexadex would you be able to check this PR across platforms? If not we can try. Would appreciate a screenrecording if you can swing it. |
|
This worked great for me. Thanks for fixing this! |
|
@zachlloyd can do it on windows and Mac, would send in the recording as soon as I can. |
|
@zachlloyd tested on Mac and Windows working-demo.mp4 |
|
awesome, thank you. putting this in the queue |
|
Actually, @fadexadex would you mind testing how this interacts with custom keybindings and verifying that if you remap page up/down nothing breaks here? |
|
@zachlloyd tested it, it works fine Screen.Recording.2026-05-04.at.09.33.01.mp4 |
|
@zachlloyd The custom keybinding should be fine because the new editable keybinding is defined in the input view layer and there is a keymap context to suppress editor layer fixed keybindings. This should work. We also have previous examples of this kind of override for the ctrl-R menu |
…v#9008) (warpdotdev#9624) ## Description Fixes [warpdotdev#9008](warpdotdev#9008). While focus is in the **prompt**, **Page Up** / **Page Down** previously behaved only as **editor navigation** (`move_page_up` / `move_page_down` on the buffer), so terminal scrollback did not move—despite docs describing terminal scrolling. This PR: 1. **Routes paging by UI state:** When **suggestions / history menus are not visible**, Page Up/Down emit **`Input` → `TerminalView`** scroll intents (`page_up` / `page_down`). When **those menus are visible**, paging stays **editor-local** so menus keep working as before. 2. **Makes shortcuts discoverable and editable:** Replaces fixed `pageup`/`pagedown` bindings with **`EditableBinding`** entries: - `terminal:scroll_up_one_page` — “Scroll terminal output up one page” (default **Page Up**) - `terminal:scroll_down_one_page` — “Scroll terminal output down one page” (default **Page Down**) Context matches terminal scroll usage (`Terminal`, non-empty block list, IME closed). 3. **Tests:** Regression coverage for prompt → terminal scroll (buffer unchanged), guard when suggestions are visible (scroll unchanged), and Vim normal-mode routing still scrolling terminal output. ## Testing - `cargo fmt --check` - `cargo test --lib` with filters for the new paging tests and bindings registration test (or equivalent `cargo nextest run -p warp` filters locally). ## Server API dependencies N/A — client-only terminal/input/bindings behavior. ## Agent Mode - [ ] Warp Agent Mode - This PR was created via Warp's AI Agent Mode ## Changelog Entries for Stable CHANGELOG-BUG-FIX: Fixed Page Up and Page Down from the prompt so they scroll terminal output when the suggestion menu is closed; shortcuts appear under Keyboard Shortcuts as editable scroll actions (`terminal:scroll_up_one_page` / `terminal:scroll_down_one_page`).
…v#9008) (warpdotdev#9624) ## Description Fixes [warpdotdev#9008](warpdotdev#9008). While focus is in the **prompt**, **Page Up** / **Page Down** previously behaved only as **editor navigation** (`move_page_up` / `move_page_down` on the buffer), so terminal scrollback did not move—despite docs describing terminal scrolling. This PR: 1. **Routes paging by UI state:** When **suggestions / history menus are not visible**, Page Up/Down emit **`Input` → `TerminalView`** scroll intents (`page_up` / `page_down`). When **those menus are visible**, paging stays **editor-local** so menus keep working as before. 2. **Makes shortcuts discoverable and editable:** Replaces fixed `pageup`/`pagedown` bindings with **`EditableBinding`** entries: - `terminal:scroll_up_one_page` — “Scroll terminal output up one page” (default **Page Up**) - `terminal:scroll_down_one_page` — “Scroll terminal output down one page” (default **Page Down**) Context matches terminal scroll usage (`Terminal`, non-empty block list, IME closed). 3. **Tests:** Regression coverage for prompt → terminal scroll (buffer unchanged), guard when suggestions are visible (scroll unchanged), and Vim normal-mode routing still scrolling terminal output. ## Testing - `cargo fmt --check` - `cargo test --lib` with filters for the new paging tests and bindings registration test (or equivalent `cargo nextest run -p warp` filters locally). ## Server API dependencies N/A — client-only terminal/input/bindings behavior. ## Agent Mode - [ ] Warp Agent Mode - This PR was created via Warp's AI Agent Mode ## Changelog Entries for Stable CHANGELOG-BUG-FIX: Fixed Page Up and Page Down from the prompt so they scroll terminal output when the suggestion menu is closed; shortcuts appear under Keyboard Shortcuts as editable scroll actions (`terminal:scroll_up_one_page` / `terminal:scroll_down_one_page`).
…v#9008) (warpdotdev#9624) ## Description Fixes [warpdotdev#9008](warpdotdev#9008). While focus is in the **prompt**, **Page Up** / **Page Down** previously behaved only as **editor navigation** (`move_page_up` / `move_page_down` on the buffer), so terminal scrollback did not move—despite docs describing terminal scrolling. This PR: 1. **Routes paging by UI state:** When **suggestions / history menus are not visible**, Page Up/Down emit **`Input` → `TerminalView`** scroll intents (`page_up` / `page_down`). When **those menus are visible**, paging stays **editor-local** so menus keep working as before. 2. **Makes shortcuts discoverable and editable:** Replaces fixed `pageup`/`pagedown` bindings with **`EditableBinding`** entries: - `terminal:scroll_up_one_page` — “Scroll terminal output up one page” (default **Page Up**) - `terminal:scroll_down_one_page` — “Scroll terminal output down one page” (default **Page Down**) Context matches terminal scroll usage (`Terminal`, non-empty block list, IME closed). 3. **Tests:** Regression coverage for prompt → terminal scroll (buffer unchanged), guard when suggestions are visible (scroll unchanged), and Vim normal-mode routing still scrolling terminal output. ## Testing - `cargo fmt --check` - `cargo test --lib` with filters for the new paging tests and bindings registration test (or equivalent `cargo nextest run -p warp` filters locally). ## Server API dependencies N/A — client-only terminal/input/bindings behavior. ## Agent Mode - [ ] Warp Agent Mode - This PR was created via Warp's AI Agent Mode ## Changelog Entries for Stable CHANGELOG-BUG-FIX: Fixed Page Up and Page Down from the prompt so they scroll terminal output when the suggestion menu is closed; shortcuts appear under Keyboard Shortcuts as editable scroll actions (`terminal:scroll_up_one_page` / `terminal:scroll_down_one_page`).
Cherry-picked from upstream: - fix: highlight C++ header extensions (warpdotdev#9388) - Run executable shell scripts in the terminal (warpdotdev#9503) - Revert schema generator binary recompilation fix (warpdotdev#9676) - Remove stray backticks from Windows installer README (warpdotdev#9691) - Fix chord shortcuts on Windows non-Latin keyboard layouts (warpdotdev#9476) - Scroll output with Page Up/Down from prompt (warpdotdev#9624) - Respect Markdown Viewer setting for .md links in AI rules/facts panel (warpdotdev#9699) - fix: disable reset grid checks for restored blocks on Windows (warpdotdev#9987) - add RedirectionGuard=no to windows-installer.iss (warpdotdev#9863) - Windows quake mode window correctly sized (warpdotdev#9891) - fix: update rand to 0.9.4 (GHSA-cq8v-f236-94qc) (warpdotdev#10060) - Fix diff button when Show code review button toggle is off (warpdotdev#9600) - Fix freshly cloned repo stuck in loading state (warpdotdev#9998) - Fix terminal text selection not auto-scrolling when dragging (warpdotdev#9448) - Resolve conflict markers from 3f0ac51 and edac651
Description
Fixes warpdotdev/warp#9008.
While focus is in the prompt, Page Up / Page Down previously behaved only as editor navigation (
move_page_up/move_page_downon the buffer), so terminal scrollback did not move—despite docs describing terminal scrolling.This PR:
Routes paging by UI state: When suggestions / history menus are not visible, Page Up/Down emit
Input→TerminalViewscroll intents (page_up/page_down). When those menus are visible, paging stays editor-local so menus keep working as before.Makes shortcuts discoverable and editable: Replaces fixed
pageup/pagedownbindings withEditableBindingentries:terminal:scroll_up_one_page— “Scroll terminal output up one page” (default Page Up)terminal:scroll_down_one_page— “Scroll terminal output down one page” (default Page Down)Context matches terminal scroll usage (
Terminal, non-empty block list, IME closed).Tests: Regression coverage for prompt → terminal scroll (buffer unchanged), guard when suggestions are visible (scroll unchanged), and Vim normal-mode routing still scrolling terminal output.
Testing
cargo fmt --checkcargo test --libwith filters for the new paging tests and bindings registration test (or equivalentcargo nextest run -p warpfilters locally).Server API dependencies
N/A — client-only terminal/input/bindings behavior.
Agent Mode
Changelog Entries for Stable
CHANGELOG-BUG-FIX: Fixed Page Up and Page Down from the prompt so they scroll terminal output when the suggestion menu is closed; shortcuts appear under Keyboard Shortcuts as editable scroll actions (
terminal:scroll_up_one_page/terminal:scroll_down_one_page).