feat: ctrl+wheel font-size zoom#1613
Conversation
Ctrl+mouse-wheel for live font-size zoom is standard in WezTerm, Windows Terminal, iTerm, and similar terminals. Issue raphamorim#792 has tracked the feature request since November 2024. Hooks into the existing MouseWheel LineDelta path: when Ctrl is held (and Shift is not, and the focused app is not in mouse-reporting mode), wheel-up calls change_font_size(Increase) and wheel-down calls Decrease, reusing the handler the keyboard shortcuts already use. Mouse-reporting mode (tmux mouse on, vim mouse) is respected so wheel events still pass through unchanged when the inner app wants them. Touchpad (PixelDelta) input intentionally falls through to default scroll behaviour. Touchpad gestures fire many small deltas per swipe; a debounced/threshold-based zoom is worth a follow-up once the simpler mouse-wheel case is in. Opt out via: [mouse] wheel-zoom = false Defaults to on so the feature is discoverable. Closes raphamorim#792.
|
Quick note on the red checks here — I don't think they're related to this change. The It looks like this traces back to The three |
Closes #792.
Ctrl+mouse-wheel zooms the font size, matching WezTerm, Windows Terminal, iTerm, and similar terminals. The feature has been requested since November 2024.
Hooks into the existing
MouseWheel::LineDeltaarm: when Ctrl is held (and Shift is not, and the focused app is not in mouse-reporting mode), wheel-up callschange_font_size(Increase)and wheel-down callsDecrease, reusing the handler the keyboard shortcuts already use. Mouse-reporting mode (tmux mouse on, vim:set mouse=a) is respected so wheel events still pass through unchanged when the inner app wants them.Touchpad (
PixelDelta) input intentionally falls through to the existing scroll path. Touchpad gestures fire many small deltas per swipe, and wiring zoom into them naively gives ~12 zoom steps per swipe; a debounced/threshold-based variant is worth a follow-up once the simpler wheel case is in.Opt out via:
Defaults to
trueso the feature is discoverable.Verified locally on Windows 11.