You are not logged in.

#1 2015-10-20 13:27:03

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

[SOLVED] Tmux 2.1 new mouse config issues - can't scroll

I just got the tmux update to 2.1-1 yesterday, and today my mouse was not working with tmux (for scrolling or selecting/copy-mode).

I found the tmux changelog here which indicates the config has changed:

changelog wrote:

* Mouse-mode has been rewritten.  There's now no longer options for:
    - mouse-resize-pane
    - mouse-select-pane
    - mouse-select-window
    - mode-mouse

  Instead there is just one option:  'mouse' which turns on mouse support
  entirely.

I applied this change, and selecting/copy-mode with the mouse is working again, but scrolling with mouse buttons 4/5 (up/down) are not.

Does scrolling work for others?

Our wiki page has not yet been revised to reflect the 2.1 changes, so while there is a section on mouse scrolling there, it is not relevant to v2.1.  I'm also not having any luck finding any other discussions of this via web searches, as few others are using tmux 2.1 yet.

EDIT: It seems scrolling works, but *only* when already in copy mode.  In the previous version of tmux I was able to scroll whether or not I was in copy mode.  I tried binding WheelUp to enter copy mode, but unless I'm missing something, mouse buttons can only be bound over pane borders or the status bar, so this doesn't work (there is no WheelUp event to be bound, only WheelUpPane or WheelUpStatus).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#2 2015-10-20 17:08:52

shane1027
Member
Registered: 2015-10-20
Posts: 7

Re: [SOLVED] Tmux 2.1 new mouse config issues - can't scroll

I'm having the same experience if it counts for anything, just updated my tmux.conf with today to re-enable mouse use, and cannot scroll except for within selecting mode...  Would love to have it back the way it was also!

Offline

#3 2015-10-21 17:20:38

ayekat
Member
Registered: 2011-01-17
Posts: 1,611

Re: [SOLVED] Tmux 2.1 new mouse config issues - can't scroll

I can confirm this, and it's pretty annoying.
However I got the old behaviour back (almost) with this:

Thomas Sattler@https://groups.google.com/forum/#!topic/tmux-users/TRwPgEOVqho wrote:

I used to have "mode-mouse on" to be able to enter (and leave) copy mode with the mouse. (Turning the wheel scrolled three-line-wise.)

I almost have this back with

bind -n WheelUpPane   select-pane -t= \; copy-mode -e \; send-keys -M
bind -n WheelDownPane select-pane -t= \;                 send-keys -M

Now it scrolls line-wise, which is even more smoothly. smile

I also configured Ctrl as a speedup-key like this:

bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M

and

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

Unfortunately bindings to Shift- or Meta-Wheel seem not to work. sad

Thomas

EDIT Actually I'm happier with this one now smile

EDIT 2 Actually I'm not quite sure I understood your problem. With abovementioned solution I can position my mouse over a pane, and it will focus the pane, enter copy-mode, and scroll. And it's WheelUpPane/WheelDownPane.

Last edited by ayekat (2015-10-21 17:26:42)


pkgshackscfgblag

Offline

#4 2015-10-21 21:01:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] Tmux 2.1 new mouse config issues - can't scroll

D'Oh - the main part of my problem binding the mouse wheel to enter copy mode was that I forgot the '-n' flag for bind.  With the -n flag it works acceptably, and the -e for copymode has it working perfectly.  Thanks.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2015-10-21 22:53:15

American_Jesus
Member
From: Lisbon/Portugal
Registered: 2011-07-20
Posts: 37

Re: [SOLVED] Tmux 2.1 new mouse config issues - can't scroll

Sorry about the reply on a Solved thread, but i found this settings behave more like in tmux <2.1

set-option -g -q mouse on
bind-key -T root PPage if-shell -F "#{alternate_on}" "send-keys PPage" "copy-mode -e; send-keys PPage"
bind-key -t vi-copy PPage page-up
bind-key -t vi-copy NPage page-down

Source: https://www.reddit.com/r/tmux/comments/ … ed/cw552qd


Archlinux X86_64

Offline

#6 2016-01-02 20:04:53

demian
Member
From: Frankfurt, Germany
Registered: 2009-05-06
Posts: 709

Re: [SOLVED] Tmux 2.1 new mouse config issues - can't scroll

I realize i'm posting in a 2-month-old solved post but it's the first one google finds so i think it belongs here.

There was a ticket on the official github:  https://github.com/tmux/tmux/issues/145
The solution proposed there is

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

This works better for me than the solutions i found in this thread.


no place like /home
github

Offline

#7 2016-02-09 14:17:52

varg04444
Member
From: Colombia
Registered: 2009-09-26
Posts: 22

Re: [SOLVED] Tmux 2.1 new mouse config issues - can't scroll

You are right @demian, works better and avoid problem with vim (with the other solution, when you scroll vim pane, it lose "focus", then no more vim commands work). Like pokemon, I choose you! XD thanks


[EN] In the world there are 10 kinds of people, those who understand binary and those who not.
[ES] En el mundo hay 10 tipos de personas, las que entienden binario y las que no.

Offline

#8 2016-02-09 14:30:59

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] Tmux 2.1 new mouse config issues - can't scroll

demian wrote:

I realize i'm posting in a 2-month-old solved ... i think it belongs here.

I agree.  Useful information can always be posted.  I never noticed the issue you mention as I'd never think of touching a mouse while in vim! wink

But I can confirm this solution does work better in those cases.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB