Skip to content

fix: keep the mouse wheel in the live view, as htop does - #14

Merged
TomyCesaille merged 1 commit into
mainfrom
wheel-stays-in-prtop
Oct 27, 2026
Merged

TomyCesaille merged 1 commit into
mainfrom
wheel-stays-in-prtop

Conversation

@TomyCesaille

@TomyCesaille TomyCesaille commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Closes #12.

Live view on macOS and Linux (prtop/terminal.py): entering the screen also turns on mouse reporting, \033[?1000h with SGR encoding \033[?1006h, and leaving turns it off. htop sets the same 1000 mode beside the alternate screen. The terminal then hands the wheel to prtop, which drops it, and the history behind the table stays out of view.

  • The key decoder drops mouse reports in both encodings. SGR reports (\033[<64;81;5M) match once < counts as a parameter byte. A terminal without SGR sends \033[M and three characters, and at column 81 the column travels as q, which would quit prtop.
  • iTerm2 never reports a click on an underlined link, so Cmd-click keeps opening the merge request, task and prod-trigger links. Selecting text takes Option in iTerm2, Shift in most other terminals.
  • Alternate scroll mode (1007) would turn the wheel into arrow keys and leave clicks alone, but iTerm2 ignores it when the profile's "Allow Alternate Mouse Scroll" is off.
  • Windows keeps its behaviour: mouse reporting there is untested.

Tried by hand in iTerm2: the wheel no longer scrolls the history behind the table.

@TomyCesaille TomyCesaille self-assigned this Oct 27, 2026
@TomyCesaille
TomyCesaille marked this pull request as ready for review October 27, 2026 15:15
@TomyCesaille
TomyCesaille merged commit 96fcf86 into main Oct 27, 2026
9 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.

Live view: the mouse wheel scrolls the terminal history behind the table

1 participant