Skip to content

feat: scroll views with the mouse wheel - #98

Merged
Bccorb merged 1 commit into
mainfrom
feat/mouse-scroll
Oct 15, 2026
Merged

Bccorb merged 1 commit into
mainfrom
feat/mouse-scroll

Conversation

@Bccorb

@Bccorb Bccorb commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Summary

The mouse wheel now scrolls, behaving exactly like the up and down arrow keys.

  • Arrow keys and the wheel share App::scroll_line_up / scroll_line_down, so the wheel scrolls whatever has focus: the help screen, an open overlay (describe, command confirm, profile picker), or the active view's selection. A list behind an open overlay or help does not move.
  • Mouse capture is enabled with the alternate screen, released while a CLI command runs (ui::terminal::suspend_tui) so the shell does not receive mouse escape sequences, restored on resume, and disabled on exit.
  • Other mouse events (clicks, drags) are ignored.

Tradeoff

Capturing the mouse means plain click-and-drag no longer selects terminal text while the app runs. Most terminals bypass capture with a modifier held while dragging (Shift in most Linux terminals, Option in iTerm2, Fn in macOS Terminal). The README notes this under the controls.

Validation

  • cargo fmt --all --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --all (230 passed), including new tests that a line of scroll moves the list selection within bounds and goes to help or an open overlay instead of the list behind it
  • Not yet exercised by hand in a terminal

@Bccorb
Bccorb merged commit d3a9a03 into main Oct 15, 2026
3 checks passed
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.

1 participant