41

I have put

set -g mouse on 
set -g mouse-select-pane on

in my .tmux.conf file and then I open tmux and create a new pane and I cant switch pane with mouse. is there something else I need to configure? I am using tmux 2.9 on Mac using zsh.

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
  • 1
    you may look at other parameters like Mouse-mode has been rewritten. There's now no longer options for: - mouse-resize-pane - mouse-select-pane - mouse-select-window - mode-mouse etc but it should have work with set -g mouse on only I guess – francois P May 02 '19 at 15:56
  • I have the same issue. I suspect it's a bug with mac. – jordanm May 02 '19 at 17:16
  • I have no insight into this issue. However, it might be beneficial to also add to your question what terminal program you are using; gnome-terminal, rxvt, etc. It's great that you indicated the tmux version, the hardware, and the shell. (With 'Mac', I assume you are running OS X/Mac OS...if not, that info is important too.) I don't know that it would matter, but I presume it could be helpful if this is an issue between the human-input-device all the way down to the tmux process. – 0xSheepdog May 02 '19 at 18:28
  • Are you using Terminal.app? I don't think it supports the mouse? Does it work with other applications, or in another terminal? – Nicholas Marriott May 02 '19 at 21:37
  • Check my answer in https://unix.stackexchange.com/questions/318281/how-to-copy-and-paste-with-a-mouse-with-tmux/318285#318285 – GMaster Sep 10 '19 at 04:03

6 Answers6

30

Here is a clarification of Mark Volkmann's answer. First make sure that you have set -g mouse on in your .tmux.conf file, and that you have sourced the file by running tmux source <whatever config file>. I have found the other line you have in your config to be unnecessary. Once you have the config file set up, run:

$ exit tmux
$ tmux kill-server
$ tmux

NOTE: In a previous version of this answer I listed Volkmann's answer as "horrible and unreadable". I do not find this to be correct nor do I find it an acceptable way to treat another person. Please accept my apology for being rude and inconsiderate.

gaetgu
  • 403
11

I had the same issue. It was fixed after I did the following:

  • exit tmux
  • enter tmux kill-server
  • enter tmux again
8

On higher version 2.1 >, use :

setw -g mouse on
haidarvm
  • 261
  • 1
    This seems incomplete. Why should you prefer setw over set? – Brandon Jan 18 '24 at 01:38
  • 1
    mouse-select-pane is removed since 2.1 https://stackoverflow.com/questions/11832199/tmux-set-g-mouse-mode-on-not-scrolling/33336609#33336609 – n0099 Mar 04 '24 at 06:00
7

After making the tmux config change, run tmux source ~/.tmux.conf for an "on-the-fly" change

H A
  • 171
  • 1
  • 2
6
# Toggle mouse with ^M; then report it's new status
bind-key C-m set-option -g mouse \; display-message 'Mouse #{?mouse,on,off}'
Elliptical view
  • 3,921
  • 4
  • 27
  • 46
3

To obtain the default behavior, which is equal as UP and DOWN keyboard arrows, use:

echo "set -g terminal-overrides 'xterm*:smcup@:rmcup@'" >> ~/.tmux.conf && tmux kill-server && tmux
NVRM
  • 398