I was in a Mosh session on a remote server and tried to do scroll using trackpad. Surprisingly instead of getting the scrolled content of the remote shell, it showed buffered content of my system’s shell!
I opened up tmux inside the mosh session thinking may be it would help. Nope the same issue.
Local tmux as well has the same issue. The scoll mode (ctrl
B
[
) in tmux with keyboard navigation worked as expected (in remote as well).

The fix
Appraently there is a quick fix with iTerm2 in Mac.
- Goto iTerm2 > Preferences > Advanced
- In Mouse section, set Scroll wheel sends arrow keys when in alternate screen mode to
Yes

Done!
Now the content will get scrolled correctly within tmux window pane in scoll mode.

Although mosh scrolling issue is not fixed (now mosh scroll gives walk through commands history), tmux mouse scrolling fix, indirectly fixed my issue. So, yay! 🎉