From 77a0380ba7fddbed31e116dae3f089893c44dae0 Mon Sep 17 00:00:00 2001 From: peace-young <42528747+peace-young@users.noreply.github.com> Date: Sat, 27 Jun 2026 00:08:23 +0800 Subject: [PATCH] feat: add Ctrl+scroll to zoom terminal font size (#64) --- src/terminal/input.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/terminal/input.rs b/src/terminal/input.rs index 5ef0f2c..366b603 100644 --- a/src/terminal/input.rs +++ b/src/terminal/input.rs @@ -481,6 +481,20 @@ impl Ashell { window: &mut Window, cx: &mut Context, ) { + // Ctrl+scroll → zoom terminal font size + if event.modifiers.control { + let delta = match event.delta { + ScrollDelta::Lines(point) => point.y as f32, + ScrollDelta::Pixels(point) => point.y.as_f32() / 100.0, + }; + if delta != 0.0 { + self.change_terminal_font_size(delta.signum() * 0.5, cx); + } + window.prevent_default(); + cx.stop_propagation(); + return; + } + let Some(active_id) = self.active_tab.clone() else { return; };