Enable mouse scrolling with tmux 2.1 on Mac

tl;dr

I finally found the solution to automatically enable and disable scrolling on Mac after the tmux upgrade. Thanks again to ArchLinux Wiki.

Add those three lines to your .tmux.conf:

Understand how it works

One thing I found missing on a lot of tech blogs is most of them have only the solution but not why it’s the case. I think we should change this so that everyone can make changes/improvements to meet their needs.

The main thing here is a bind-key command, so let’s check the manual first.

Official manual page on OpenBSD

To understand the command: