To enable mouse support in tmux, add set -g mouse on
to your .tmux.conf
file. For temporary enabling during a session, use :set -g mouse on
in tmux command mode.
$ echo "set -g mouse on" >> ~/.tmux.conf
Mouse support in tmux allows you to use your mouse for various operations, including selecting and resizing panes, scrolling through terminal output, and selecting text for copying. This feature makes tmux more intuitive for newcomers and can speed up certain workflows.
To enable mouse support permanently, add the following line to your ~/.tmux.conf
file:
set -g mouse on
Then reload your tmux configuration:
$ tmux source-file ~/.tmux.conf
To enable mouse support for the current tmux session only, press your tmux prefix (default: Ctrl+b) followed by : to enter command mode, then type:
set -g mouse on
In older tmux versions, you needed multiple settings instead of the single command:
set -g mouse-select-pane on set -g mouse-resize-pane on set -g mouse-select-window on set -g mode-mouse on
When mouse mode is enabled, you'll need to hold the Shift key while selecting text to bypass tmux and let your terminal handle the selection.