As the title suggests, I want to select a pane in tmux by just doing mouse over on the pane, like it can be done with Gnome Terminal. I don't want to click the pane to select it.

Is that possible?


Correct me if I am wrong, but I don't believe this is (easily) possible. The only reason that clicking between panes is possible is because your terminal application will forward mouse position to the terminal application on mouse click.

As an example, enable this in your ~/.tmux.conf file:

set-window-option -g mode-mouse on

With this enabled, the terminal cursor can be dragged around inside a tmux pane. This shows why it is possible to click between panes, and resize panes with your mouse. Your terminal application (xterm, for example) does the broadcasting of mouse cursor location to the terminal application, when you click. tmux can then use that information to, for example, move the terminal cursor, or switch to/resize panes as I explained above.

I don't see any evidence online that someone has managed to do change tmux panes by hovering over a different one.

Unless you rewrite parts of a terminal application so that it always broadcasts mouse location (even when you don't click), and then alter tmux so that it always keeps track of it (or something similar), I don't see a solution.

I honestly just suggest adding this line to your ~/.tmux.conf file. It allows you to change panes just by clicking on a different one, which I don't see being much more inconvenient than only hovering over it:

set-option -g mouse-select-pane on
| improve this answer | |
  • I know about the mouse-select-pane-on. That's what I have right now in my tmux.conf file. Just wanted to find out if someone has managed to get pane selection on mouse hover working. – ronakg Jun 6 '15 at 17:22

If you are using iTerm2 with Tmux you can check the iTerm > Preferences > Pointer > Focus follows mouse check box. This will probably only work with selected Tmux themes but could be worth giving it a try.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.