Skip to content

fix(terminal): scroll output with Page Up/Down from prompt (#9008)#9624

Merged
kevinyang372 merged 2 commits intowarpdotdev:masterfrom
fadexadex:fadex/fix-9008-terminal-page-scroll
May 4, 2026
Merged

fix(terminal): scroll output with Page Up/Down from prompt (#9008)#9624
kevinyang372 merged 2 commits intowarpdotdev:masterfrom
fadexadex:fadex/fix-9008-terminal-page-scroll

Conversation

@fadexadex
Copy link
Copy Markdown
Contributor

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_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 InputTerminalView 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)

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
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 30, 2026

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 @cla-bot check to trigger another check.

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 30, 2026

@fadexadex

I'm starting a first review of this pull request.

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

You can view the conversation on Warp.

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@fadexadex
Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Apr 30, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 30, 2026

The cla-bot has been summoned, and re-checked this pull request!

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread app/src/terminal/input.rs
self.editor
.update(ctx, |input, ctx| input.move_page_up(ctx));
} else {
ctx.emit(Event::PageUp);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] This still hard-codes Page Up/Down from the prompt through the editor's fixed 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
@fadexadex fadexadex force-pushed the fadex/fix-9008-terminal-page-scroll branch from 4f0aba4 to 55423ec Compare April 30, 2026 16:54
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread app/src/terminal/view/init.rs
@fadexadex
Copy link
Copy Markdown
Contributor Author

fadexadex commented Apr 30, 2026

@oz-agent review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 30, 2026

@fadexadex

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:

  • Review the changes pushed to this PR.
  • Follow up with another comment if further adjustments are needed.

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@oz-for-oss oz-for-oss Bot requested a review from kevinyang372 April 30, 2026 16:59
oz-for-oss[bot]
oz-for-oss Bot previously requested changes Apr 30, 2026
Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread app/src/terminal/input.rs
@captainsafia captainsafia added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Apr 30, 2026 — with Warp Dev Github Integration
@zachlloyd
Copy link
Copy Markdown
Contributor

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

@fadexadex
Copy link
Copy Markdown
Contributor Author

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.

@zachlloyd
Copy link
Copy Markdown
Contributor

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!

@zachlloyd
Copy link
Copy Markdown
Contributor

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.

@kevinyang372
Copy link
Copy Markdown
Member

This worked great for me. Thanks for fixing this!

@fadexadex
Copy link
Copy Markdown
Contributor Author

@zachlloyd can do it on windows and Mac, would send in the recording as soon as I can.

@fadexadex
Copy link
Copy Markdown
Contributor Author

@zachlloyd tested on Mac and Windows

working-demo.mp4

@zachlloyd
Copy link
Copy Markdown
Contributor

awesome, thank you. putting this in the queue

@zachlloyd
Copy link
Copy Markdown
Contributor

Actually, @fadexadex would you mind testing how this interacts with custom keybindings and verifying that if you remap page up/down nothing breaks here?

@fadexadex
Copy link
Copy Markdown
Contributor Author

@zachlloyd tested it, it works fine

Screen.Recording.2026-05-04.at.09.33.01.mp4

@kevinyang372
Copy link
Copy Markdown
Member

@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

@kevinyang372 kevinyang372 merged commit 71edcac into warpdotdev:master May 4, 2026
43 of 45 checks passed
wolverine2k pushed a commit to wolverine2k/warp that referenced this pull request May 5, 2026
…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`).
Leejaywell pushed a commit to Leejaywell/warp that referenced this pull request May 5, 2026
…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`).
Leejaywell pushed a commit to Leejaywell/warp that referenced this pull request May 5, 2026
…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`).
Leejaywell added a commit to Leejaywell/warp that referenced this pull request May 5, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scroll Up One Page and Scroll Down One Page shortcuts don’t work

4 participants