Configure tmux scroll speed

Viewed 12101

Can tmux scroll speed (using a mouse wheel or touch pad) be configured?

Tmux 2.1 sort of broke scrolling (depending on your configuration), forcing me to update my config. I did that a few weeks ago.

But now I think tmux scrolls* slower than it used to. I think I read you can configure the scroll speed but I can't find any mention of that anywhere now.

* Scrolling with a mouse wheel that is. (I'm actually using a Macbook trackpad but I think it's equivalent to a mouse wheel.)

I know you can do 10C-u (with vi key bindings) to jump up 10 pages, but I'd also like to be able to just scroll fast with the mouse.

I think this is all the relevant config I personally have currently:

# Use the mouse to select panes, select windows (click window tabs), resize
# panes, and scroll in copy mode.
# Requires tmux version >= 2.1 (older versions have different option names for mouse)
set -g mouse on

# No need to enter copy-mode to start scrolling.
# From github.com/tmux/tmux/issues/145
# Requires tmux version >= 2.1 (older versions have different solutions)
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
6 Answers

I couldn't get any of the answers here working as of tmux 2.6 (last tested on 3.2), eventually figured it out so posting another answer.

This works as a stand-alone configuration file.

set -g mouse on

set-option -g status-keys vi
set-window-option -g mode-keys vi

bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up
bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down

For tmux 2.4 and above, the following works for me:

bind -Tcopy-mode WheelUpPane send -N1 -X scroll-up
bind -Tcopy-mode WheelDownPane send -N1 -X scroll-down

This sets it to scroll 1 line at a time.

From the changelog - look for Changes from 2.3 to 2.4

Related