ConEmu: Scroll wheel does not work in tmux in WSL

Versions

ConEmu build: 170402-Preview x64 OS version: Windows 10, build 15063 (Creators Update RTM) x64 Used shell version: WSL, invoked as a new task via *"%windir%\system32\bash.exe -cur_console:p" tmux version: 2.1 WSL Ubuntu version: 16.04

Problem description

When attempting to scroll a buffer in a WSL tab running tmux, instead of scrolling, the error chime plays, and either ~2 or ~3 is printed to the input buffer (depending on the direction scrolled).

Steps to reproduce

  1. Start a new WSL ConEmu tab via bash.exe -cur_console:p (or via the task listed above)
  2. Open a tmux session.
  3. Generate enough output that vertical scrolling is required.
  4. Attempt to use the mouse’s scroll wheel.

Actual results

The Windows error chime plays, and the ~2 or ~3 is entered into the input buffer.

Expected results

The tmux buffer scrolls.

Interesting notes

Bizarrely, if I show the RealConsole, and attempt to scroll my tmux buffer in that window, it works just fine.

I can also confirm that scrolling works as expected in a plain old Powershell window that’s running WSL.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 21
  • Comments: 25 (6 by maintainers)

Most upvoted comments

I am using cmder (based on ConEmu), and I fix it by checking on the option “Send mouse events to console”: Win + Alt + P -> Keys & Macro -> Mouse Options, then check on “Send mouse events to console” option.

@Maximus5 It seems that the culprit here is the set -s escape-time 0 in .tmux.conf!

escape-time time Set the time in milliseconds for which tmux waits after an escape is input to determine if it is part of a function or meta key sequences. The default is 500 milliseconds.

This escape-time is often set to 0 in tmux to avoid lagging with vim, but I guess here it didn’t let the mouse click time to “finish”… clicking? Putting it to 20 ms seems to do the job without making vim lag too much.

@tfriedel @XA21X , would you be in the same situation here, with escape-time modified in your .tmux.conf?

Apologies, there’s one extra reproduction step I forgot to mention:

3.5. In tmux, enable mouse mode with tmux set mouse.

This will enable mousewheel scrolling.

thanks, it’s basically working now. however quite often an event (scroll wheel or mouse click) is missed and instead some control characters appear in the console. like: [❤️;29;1m[<0;20;1M[❤️;30;1m

@Maximus5 I can confirm that there is still issues on 190217 with mouse & tmux. tmux v2.8, set -g mouse on in .tmux.conf

I launched tmux on bash (set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --log D:/Eloi/Bugs --wsl -new_console:m:"" -C~ -t bash) and did all clicks on my mouse (if I remember correctly, left, right, middle, wheel down, wheel up).

image connector-10660-in.log connector-10660-out.log

I’m working on improving pty interface. Until then ConEmu does what it can at most