Skip to content

Add support for mouse wheel scroll in the central pane - #4

Open
staale wants to merge 2 commits into
maedana:mainfrom
staale:feat/mouse-wheel-preview-scroll
Open

Add support for mouse wheel scroll in the central pane#4
staale wants to merge 2 commits into
maedana:mainfrom
staale:feat/mouse-wheel-preview-scroll

Conversation

@staale

@staale staale commented Jun 11, 2026

Copy link
Copy Markdown

This fixes so that scroll-wheel works in the central pane in crmux, provided the signals are passed in from the terminal emulator.

Note: I am not a rust developer, and used claude code to assist in this patch. I use this build myself locally and it seems to work fine.

staale and others added 2 commits June 5, 2026 06:59
Mouse capture is already enabled, but wheel events were dropped on the
floor (the catch-all arm in handle_key_event). Route MouseEventKind::
ScrollUp / ScrollDown into the existing preview-scroll machinery so the
wheel mirrors the Ctrl+u / Ctrl+d keyboard scrolling.

Scrolling targets the selected session's preview, moves 3 lines per
notch, enters Scroll mode on the way up and returns to Normal mode once
the bottom is reached. Only active in Normal and Scroll modes so it does
not interfere while typing in Input/Broadcast/Title.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The scroll offset was capped at preview_height * 3, so the wheel (and the
existing Ctrl+u / gg keyboard scrolling) stopped after roughly three
screens regardless of how long the session history was.

Derive the cap from the captured content length instead
(effective_max_scroll). Scrollback capture is lazy - only when
preview_scroll > 0 - so before the first scroll the content is just the
visible screen; a one-screen floor lets that first scroll move and
trigger the full capture, after which the measured length takes over. The
UI already clamps the rendered offset to the real content, so this only
removes the artificial navigation ceiling.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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