From 657e6e181ac05c3d614572b296310b1b02fe8e4c Mon Sep 17 00:00:00 2001 From: Jonas Haugesen Date: Tue, 4 Aug 2026 10:49:48 +0200 Subject: [PATCH] wezterm mouse scroll --- wezterm/.config/wezterm/wezterm.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/wezterm/.config/wezterm/wezterm.lua b/wezterm/.config/wezterm/wezterm.lua index 23138e2..e986a1c 100644 --- a/wezterm/.config/wezterm/wezterm.lua +++ b/wezterm/.config/wezterm/wezterm.lua @@ -63,6 +63,27 @@ config.keys = { }, } +-- Mouse: tame scrollback wheel scrolling. +-- This only affects the MAIN screen / scrollback (e.g. `pi`, which does not +-- enable mouse reporting or the alternate screen, so the wheel falls through to +-- wezterm's native scrollback - which gets amplified into page jumps with +-- Wayland high-resolution wheels). Alt-screen apps that capture the mouse +-- (nvim, less, etc.) are unaffected: they go through +-- `alternate_buffer_wheel_scroll_speed` instead. Lower the line count for finer +-- steps, raise it for faster scrolling. +config.mouse_bindings = { + { + event = { Down = { streak = 1, button = { WheelUp = 1 } } }, + mods = 'NONE', + action = wezterm.action.ScrollByLine(-3), + }, + { + event = { Down = { streak = 1, button = { WheelDown = 1 } } }, + mods = 'NONE', + action = wezterm.action.ScrollByLine(3), + }, +} + -- Machine-local overrides (not tracked in dotfiles) -- Create ~/.config/wezterm/local.lua returning a function that mutates config local ok, local_config = pcall(require, 'local')