Configure tmux scroll speed

前端 未结 6 1565
时光取名叫无心
时光取名叫无心 2021-02-04 00:29

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 confi

6条回答
  •  说谎
    说谎 (楼主)
    2021-02-04 00:52

    I agree, the scrolling speed with only one line at the line is much too slow. You can make it jump half-pages:

    bind -t emacs-copy WheelUpPane   halfpage-up
    bind -t emacs-copy WheelDownPane halfpage-down
    

    Still the half-page fix proposed here is much too fast and destroyes the impression of scrolling by replacing it with only the sensation of jumping. To make the scroll go at a custom speed you can add several send-keys commands like this:

     # Scrolling in tmux
     set -g mouse on
     bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M; send-keys -M; send-keys -M; send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M; send-keys -M; send-keys -M; send-keys -M' 'copy-mode -e; send-keys -M; send-keys -M; send-keys -M; send-keys -M'"
     bind -n WheelDownPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M; send-keys -M; send-keys -M; send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M; send-keys -M; send-keys -M; send-keys -M' 'copy-mode -e; send-keys -M; send-keys -M; send-keys -M; send-keys -M'"
    

提交回复
热议问题