23

It scrolls ok in vim but not in tmux.

I followed suggestions like adding

set -g history-limit 1000
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
setw -g mode-mouse on
set-window-option -g mode-mouse on

to .tmux.conf but none of them helped

All I get, regardless of the above is history command scrolling.

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
  • 1
    You're issuing commands at shell prompt, therefore set is most likely being understood a bash's builtin (cf. help set) while setw doesn't exist so your system tries to suggest the closest match it knows. The set and setw (shorthand for set-window-option) are tmux's command and you can use them at tmux's command prompt, prompted by ctrl-B, or as an argument to tmux command itself as in "tmux setw -g mode-mouse on" – anddam Sep 27 '12 at 09:15

3 Answers3

36

Correct command is:

set -g mode-mouse on

You can also add it to your ~/.tmux.conf

  • 7
    You need to type it in tmux command prompt (type CTRL-b and :).. Read the manual. –  Jun 06 '12 at 09:01
  • 1
    When I do this, I just get gibberish characters appearing at the prompt (any terminal prompt, e.g. bash prompt or IPython prompt, etc.) What else needs to happen for mode-mouse to do naive scrolling? – ely Aug 01 '13 at 15:40
  • 11
    Its just `set -g mouse on` for me. (version `2.1-1`) – Czipperz Feb 06 '16 at 00:35
  • As noted in the [tmux wiki](https://wiki.archlinux.org/index.php/Tmux#Mouse_scrolling), > This interferes with selection buffer copying and pasting. To copy/paste to/from the selection buffer hold the shift key. – dskrvk Feb 18 '16 at 18:41
  • 2
    This doesn't work on new tmux versions so it should be updated with correct information or removed as correct answer. – valentt Dec 28 '17 at 08:46
21

Just to link two relevant answers together:

Why does tmux set -g mouse-mode on no longer work?

As pointed out in this answer, the option got renamed since tmux version 2.1 to:

tmux set -g mouse on

To find your local tmux version, just run tmux -V.

Syed Priom
  • 1,893
  • 1
  • 21
  • 22
ojdo
  • 8,280
  • 5
  • 37
  • 60
0
set -g mouse on

Just like this if it's going in your ~/.tmux.conf