Mouse scrolling in MobaXterm tmux
Andrew Mclaughlin
On my Linux computer I have the following .tmux.conf file:
# Enable mouse mode (tmux 2.1 and above)
set -g mouse onThis allows me to scroll up and down using the mouse wheel while in a tmux session.
If I use Ubuntu on Windows (WSL) to ssh to my Linux computer, this still works fine. I can tmux attach to the session and scroll up and down using my mouse just fine. I can also see the entire history of the tmux session (up to the maximum scrollback limit), but I can't see the ssh command or the tmux attach:
Notice I'm able to scroll back all the way to the start of the session, but the
ssh and tmux attach commands don't appear.
However, this fails if I use a MobaXterm WSL-Ubuntu session. I start a WSL-Ubuntu session and use the same commands, but now the scroll wheel just fills in the last command, rather than scrolling up:
Additionally, if I scroll up using MobaXterm's scrollbar on the right, I can still see the outside history, and not the session history:
The regular tmux Ctrl+BPgUp scrolls through the session history just fine even in MobaXterm though.
How do I get the behaviour from the Linux/WSL terminal in my MobaXterm WSL-Ubuntu session?
11 Answer
You can try to set the Run method of wsl to 'Native connector' and add
set -g terminal-overrides 'xterm*:smcup@:rmcup@'to ~/.tmux.conf.
See Archlinux: Tmux#Scrolling_issues for more details.
1