Enabling mouse modes

First, it's worthwhile to note that one of the main benefits of tmux is to obviate the need to reach for your mouse as often as you otherwise would. So, some purists would balk at the notion of enabling mouse modes for tmux.

That said, it is often rather convenient to use the mouse to scroll, select text, resize panes, choose an option from a list, and more. And yes, tmux allows you to do all of that with the mouse. These features are disabled by default so to enable them, we need to add the following lines to our .tmux.conf (either Emacs or vi):

set-window-option -g mouse-mode on
set-option -g mouse-select-window on
set-option -g mouse-select-pane on
set-option -g mouse-resize-pane on

This will enable mouse functionality in ...

Get Getting Started with tmux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.