tmux: Fix scrolling down in alternate mode

Scrolling down with the mouse wheel in alternate mode (e.g. less)
stopped working for me. I'm pretty sure that this used to work, but tmux
never had a default binding for WheelDownPane, so I'm unsure from where
this change should have come from ¯\_(ツ)_/¯
This commit is contained in:
2025-08-06 11:21:51 +02:00
parent fc0cf2ff0a
commit 59863b28b3

View File

@@ -117,6 +117,21 @@ bind -T copy-mode-vi WheelDownPane {
} }
} }
# Make mouse wheel scroll down properly in alternate mode
bind -n WheelDownPane {
send -M
if -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" {
send -M
} {
if -F "#{alternate_on}" {
send -N5 down
} {
# we're already at the bottom of the history, so nothing
# needs to be done here
}
}
}
# Split panes with > and < # Split panes with > and <
unbind % unbind %
bind < splitw -v -c "#{pane_current_path}" bind < splitw -v -c "#{pane_current_path}"