How to enable scrolling in tmux panels with mouse wheel?

LinuxTmux

Linux Problem Overview


Need to enable scrolling into tmux panels with mouse wheel. How can I get that tips? Can I use it (if its exist of course) with mouse-select-pane on option?

Linux Solutions


Solution 1 - Linux

Origin Answer (deprecated)

Try this:

setw -g mode-mouse on

It can be used with the mouse-select-pane on and mouse-select-window on options.

Update

After tmux 2.1, mode-mouse option is no longer available. You should now use:

set -g mouse on

to capture mouse event.

Solution 2 - Linux

There are some changes for Tmux 2.1

  • Mouse-mode has been rewritten. There's now no longer options for:

    • mouse-resize-pane
    • mouse-select-pane
    • mouse-select-window
    • mode-mouse

    Instead there is just one option: 'mouse' which turns on mouse support entirely.

So set -g mouse on

Update:

I have to use this script to make scrolling work again: https://github.com/NHDaly/tmux-scroll-copy-mode

Solution 3 - Linux

From https://blogs.oracle.com/samf/entry/smcup_rmcup_hate

In .tmux.conf:

set -g terminal-overrides 'xterm*:smcup@:rmcup@'

where, for instance, mouse scrolling in vim in tmux scrolls vim, NOT tmux history. Very beneficial, and VERY different from history scrolling.

Solution 4 - Linux

For Mac OSX 10.9

First Install SimpleSIMBL

Then Install MouseTerm

Add this to your ~/.tmux.conf

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

For VIM Scrolling add this to your ~/.vimrc

set mouse=a
set ttymouse=xterm

Notes: see also: https://stackoverflow.com/questions/1727261/scrolling-inside-vim-in-macs-terminal

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionmart7iniView Question on Stackoverflow
Solution 1 - Linuxdm4View Answer on Stackoverflow
Solution 2 - LinuxdanielView Answer on Stackoverflow
Solution 3 - LinuxAnil GView Answer on Stackoverflow
Solution 4 - Linuxuser160917View Answer on Stackoverflow