Skip to content

fix(terminal): page full-screen Pi without mouse reporting - #854

Open
Aschenbath wants to merge 1 commit into
Kuddev:mainfrom
Aschenbath:feat/pi-wheel-paging-781
Open

Aschenbath wants to merge 1 commit into
Kuddev:mainfrom
Aschenbath:feat/pi-wheel-paging-781

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

Result / 用户结果

Closes #781

When a current Pi workload uses the alternate screen with alternate scrolling enabled and no application mouse reporting, an unmodified wheel event now sends one PageUp/PageDown command instead of cursor arrows. Fractional wheel deltas still accumulate before paging. Existing application mouse reporting takes priority, and other foreground programs retain their existing scrolling behavior.

Design / 设计边界

  • The GPUI pointer adapter owns this fallback and uses the shared terminal key encoder, including negotiated Kitty press/release events.
  • Reuse the current-program classifier used by Send-to-Chat. Explicit OSC 7501 program identity takes precedence; retained conversation identity cannot page another foreground program.
  • No new dependencies, settings, persisted formats, or thread/lifetime changes. The rationale and upstream Pi key-binding evidence are in architecture/notes/nebula_app/gpui_shell/terminal/view/2026-10-31-pi-wheel-paging.md.

Evidence / 验证依据

  • cargo test --locked -p nebula --features gpui-test-support --bin pebrel pointer:: -- --test-threads=1: 43 passed.
  • cargo test --locked -p nebula --features gpui-test-support --no-fail-fast -- --test-threads=1: 2,725 unit tests passed, 36 ignored, 1 failed; 27 integration tests passed, 1 ignored. The sole failure is git_completion::tests::real_branches_cache_invalidation_and_directory_context (nested release-tag completion), also reproduced in the pre-change test binary. Its source matches origin/main.
  • cargo check --locked -p nebula --bin pebrel --features gpui-shell --tests: passed, with warnings in unchanged code.
  • cargo clippy --locked -p nebula --all-targets --features gpui-test-support: blocked by 19 existing errors in nebula_terminal. The core source matches origin/main; cargo clippy --locked -p nebula_terminal reproduces the same diagnostics and locations. No lint rules were weakened.
  • cargo test --locked -p nebula-settings: 107 passed. The isolated i18n contract suite: 24 passed, 1 ignored.
  • cargo fmt --all -- --check, git diff --check, and python3 scripts/check_architecture.py --base 42ffd11ff95db61eacaf026319c0bfb3bed3bea1: passed. The three architecture/governance unittest modules: 55 passed.

Local builds used one Cargo job, disabled incremental compilation and debug information. Two early test builds were killed with SIGKILL during code generation; the completed builds used MALLOC_ARENA_MAX=1 MALLOC_TRIM_THRESHOLD_=0 MALLOC_TOP_PAD_=0, cleared by the Cargo runner for test execution. Clippy was also attempted with a command-line profile.dev.package.nebula.codegen-units=256 override. No build configuration files changed.

The existing pre-fix test binary reproduced the defect: one three-line wheel event emitted three Up-arrow sequences instead of PageUp. The regression dispatches through the real terminal element and covers both directions, one-page batching, fractional accumulation, Kitty encoding, SGR precedence, stale identity, explicit program status, and alternate-screen exit. Routing tests cover mode and modifier exclusions.

The batching assertion observes one transport message per event. Identity normalization and key encoding may allocate; no allocation-free or universal performance claim is made.

Linux validation uses virtual GPUI windows. Live Pi, native macOS-to-Windows SSH, and visual/platform acceptance were not run. This fixes the fallback when mouse reporting is absent; it does not establish why reporting was unavailable in the original SSH connection. Pi owns its internal transcript and scrollbar; the test confirms Pebrel has no local scrollback thumb on that alternate screen.

Required Review / 必须确认

  • Followed CONTRIBUTING.md, docs/architecture.md, and docs/project-constraints.md.
  • Kept responsibilities cohesive and reused existing behavior authorities.
  • Architecture validation passes without budget changes.
  • Added regression coverage and stated platform/feature and validation limitations.
  • No new UI messages; i18n additions are not applicable.
  • No governance rules changed; governance revision requirements are not applicable.

@Aschenbath
Aschenbath requested a review from Kuddev as a code owner November 1, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] macOS 通过 SSH 连接 Windows 运行 Pi 全屏模式时滚轮无效(2.3.0)

1 participant