Configure tmux scroll speed

前端 未结 6 1573
时光取名叫无心
时光取名叫无心 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:50

    Well here's a fairly bad solution (using vim navigation mode, note the k and j).

    bind-key -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if-shell -Ft= '#{pane_in_mode}' 'send-keys 5 k' 'copy-mode -e'"
    
    bind-key -n WheelDownPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if-shell -Ft= '#{pane_in_mode}' 'send-keys 5 j'"
    

    Not sure yet what all the tradeoffs are, but for starters it is bad because 1, the cursor moves all over the place and 2, there is a lag when you switch directions, from scrolling up to scrolling down or vice versa, while the cursor moves to the other edge of the pane.

    It does have the advantage though of a configurable velocity. Just change the 5's to adjust speed.

    Full disclosure: I think that must have been heavily inspired by something I read somewhere else, because it's not very familiar now. I wish I would have credited my sources.

提交回复
热议问题