Add support for mouse wheel scroll in the central pane - #4
Open
staale wants to merge 2 commits into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.