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 all of the ways we described. We haven't yet dealt with panes, but when we touch on that in Chapter 3, Sessions, Windows, and Panes, it will be more apparent how using the mouse to resize them will be incredibly convenient.