Skip to content

feat(input): Ctrl+scroll changes font size#77

Open
roramirez wants to merge 1 commit into
mainfrom
feat/ctrl-scroll-font-zoom
Open

feat(input): Ctrl+scroll changes font size#77
roramirez wants to merge 1 commit into
mainfrom
feat/ctrl-scroll-font-zoom

Conversation

@roramirez

Copy link
Copy Markdown
Owner

Summary

Holding Ctrl while scrolling the mouse wheel now changes the active pane's font size (scroll up = bigger, scroll down = smaller) instead of scrolling the viewport. This matches common terminal zoom behavior and reuses the existing font-size machinery.

Changes

  • src/app_event.rs: handle_mouse_wheel now checks self.modifiers.state().control_key() first; when Ctrl is held it calls the existing change_font_size helper (+1/-1) and returns, taking priority over both the mouse-reporting (>=1000) path and viewport scrolling.
  • src/main_test.rs: added tests that Ctrl+wheel-up increases and Ctrl+wheel-down decreases the active pane's font size, and that a wheel event without Ctrl leaves the font size unchanged.
  • CHANGELOG.md, README.md, doc/SPEC.md: documented the new Ctrl+scroll shortcut alongside the existing font-size shortcuts.

How to test

  • cargo test — the two new tests in src/main.rs (ctrl_wheel_up_increases_font_and_down_decreases, wheel_without_ctrl_leaves_font_untouched) pass.
  • Manual: run mmterm, hold Ctrl and scroll the mouse wheel over a pane; the font grows/shrinks (clamped 6..=72). Scrolling without Ctrl still scrolls the viewport.

Holding Ctrl while scrolling the mouse wheel now zooms the active
pane's font size (up = bigger, down = smaller) via the existing
change_font_size helper, taking priority over mouse reporting and
viewport scrolling.
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