4

On my Linux computer I have the following .tmux.conf file:

# Enable mouse mode (tmux 2.1 and above)
set -g mouse on

This 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: enter image description here

enter image description here 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:

enter image description here

Additionally, if I scroll up using MobaXterm's scrollbar on the right, I can still see the outside history, and not the session history:

enter image description here

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?

1
  • I myself (a lover of MobaXTerm) began using VcXSrv instead for this purpose. I am not saying that it will fix your problem.. what I am saying is that it has many more options to tweak around problem like this and runs more seamlessly for this application. Also, I run VcXSrv at startup with the parameters I want and don't need to sweat the 8mb footprint it uses. Commented Feb 2, 2021 at 16:35

2 Answers 2

3

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.

2
  • I'm not quite clear as to what smcup and rmcup are, so I don't know if this will cause other issues down the line, but this resolves the problem I had, so I'm accepting this answer. Commented Mar 18, 2021 at 14:28
  • @MatedeVita For the existed session, how to make effect ? detach and attach ?
    – Lewis Chan
    Commented Nov 3, 2023 at 12:31
3

Just press shift while scrolling.

See https://www.youtube.com/watch?v=g-RjgnoDLio

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Oct 12, 2022 at 14:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .