New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll wheel does not work in tmux in WSL #1114

Open
pingzing opened this Issue Apr 18, 2017 · 11 comments

Comments

Projects
8 participants
@pingzing

pingzing commented Apr 18, 2017

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.

@pingzing

This comment has been minimized.

Show comment
Hide comment
@pingzing

pingzing Apr 18, 2017

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.

pingzing commented Apr 18, 2017

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.

@mdeguzis

This comment has been minimized.

Show comment
Hide comment
@mdeguzis

mdeguzis May 18, 2017

Mouse mode indeed does not work for me either. Turning off mouse mode does not help. This behavior is more clear when you split horizontally in Tmux and attempt to scroll the top or bottom pane.

mdeguzis commented May 18, 2017

Mouse mode indeed does not work for me either. Turning off mouse mode does not help. This behavior is more clear when you split horizontally in Tmux and attempt to scroll the top or bottom pane.

@jhgorse

This comment has been minimized.

Show comment
Hide comment
@jhgorse

jhgorse Jun 16, 2017

I have tried various mouse configurations, including on the tmux side to no avail.
https://github.com/NHDaly/tmux-better-mouse-mode

I wonder what is the best way to debug the character escape sequences of a terminal emulator? In any case, onward.

jhgorse commented Jun 16, 2017

I have tried various mouse configurations, including on the tmux side to no avail.
https://github.com/NHDaly/tmux-better-mouse-mode

I wonder what is the best way to debug the character escape sequences of a terminal emulator? In any case, onward.

@dmak

This comment has been minimized.

Show comment
Hide comment
@dmak

dmak Oct 13, 2017

I have similar issue with ConEmu 170807, which is running Cygwin ssh via conenu-cyg-32.exe, which is running tmux v2.3, which is running mc v4.8.18. In this combination mouse does not work in mc. If started without tmux, mc works fine. Scrolling also works fine in tmux. Seems like to be a tmux or mc issue (vim works fine under tmux), but I wonder if somebody can advise how to debug the issue. I don't have WSL installed, the command-line is conemu-cyg-32.exe ssh user@host.

dmak commented Oct 13, 2017

I have similar issue with ConEmu 170807, which is running Cygwin ssh via conenu-cyg-32.exe, which is running tmux v2.3, which is running mc v4.8.18. In this combination mouse does not work in mc. If started without tmux, mc works fine. Scrolling also works fine in tmux. Seems like to be a tmux or mc issue (vim works fine under tmux), but I wonder if somebody can advise how to debug the issue. I don't have WSL installed, the command-line is conemu-cyg-32.exe ssh user@host.

@hansjny

This comment has been minimized.

Show comment
Hide comment
@hansjny

hansjny May 23, 2018

I have the same issue using ConEmu with WSL and then attempting to use the mouse with vim (mouse=a). Works fine with regular cmd or powershell.

hansjny commented May 23, 2018

I have the same issue using ConEmu with WSL and then attempting to use the mouse with vim (mouse=a). Works fine with regular cmd or powershell.

@Maximus5 Maximus5 added the ansi label May 24, 2018

@Maximus5 Maximus5 added this to To Do in Inspection via automation May 24, 2018

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Jun 21, 2018

Owner

How do you run WSL?

Owner

Maximus5 commented Jun 21, 2018

How do you run WSL?

@tfriedel

This comment has been minimized.

Show comment
Hide comment
@tfriedel

tfriedel Jul 22, 2018

this is a dealbreaker for me. I'm running WSL with c:\Users\thomas\AppData\Local\Microsoft\WindowsApps\ubuntu.exe -cur_console:p -c fish

tfriedel commented Jul 22, 2018

this is a dealbreaker for me. I'm running WSL with c:\Users\thomas\AppData\Local\Microsoft\WindowsApps\ubuntu.exe -cur_console:p -c fish

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Jul 22, 2018

Owner

How many times I shall explain that using of connector is essential?

  1. Read BashOnWindows in ConEmu
  2. Download and install latest ConEmu build (180628 at the moment)
  3. Run ConEmu64.exe -basic -run {bash}
Owner

Maximus5 commented Jul 22, 2018

How many times I shall explain that using of connector is essential?

  1. Read BashOnWindows in ConEmu
  2. Download and install latest ConEmu build (180628 at the moment)
  3. Run ConEmu64.exe -basic -run {bash}
@tfriedel

This comment has been minimized.

Show comment
Hide comment
@tfriedel

tfriedel Jul 22, 2018

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:
[<3;29;1m[<0;20;1M[<3;30;1m

tfriedel commented Jul 22, 2018

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:
[<3;29;1m[<0;20;1M[<3;30;1m

@Maximus5

This comment has been minimized.

Show comment
Hide comment
@Maximus5

Maximus5 Jul 22, 2018

Owner

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

Owner

Maximus5 commented Jul 22, 2018

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

@XA21X

This comment has been minimized.

Show comment
Hide comment
@XA21X

XA21X Jul 31, 2018

I'm having the same issue as @tfriedel, where mouse support mostly works but occasionally (sometimes very frequently) sending unrecognised escape codes instead. For me, it only happens in tmux at the prompt with mouse mode turned on, but somehow, neovim within tmux doesn't have this problem - maybe vim filters out unrecognised escape codes whereas tmux prints/types them?

I'm using Debian with fish shell (set via chsh) in WSL launched with the following command:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -C~ -cur_console:pm:/mnt --distro-guid={b281fda1-fa8a-49c7-a85f-dd2cc85bec24}

XA21X commented Jul 31, 2018

I'm having the same issue as @tfriedel, where mouse support mostly works but occasionally (sometimes very frequently) sending unrecognised escape codes instead. For me, it only happens in tmux at the prompt with mouse mode turned on, but somehow, neovim within tmux doesn't have this problem - maybe vim filters out unrecognised escape codes whereas tmux prints/types them?

I'm using Debian with fish shell (set via chsh) in WSL launched with the following command:
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -C~ -cur_console:pm:/mnt --distro-guid={b281fda1-fa8a-49c7-a85f-dd2cc85bec24}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment