wslbridge icon indicating copy to clipboard operation
wslbridge copied to clipboard

re-attached tmux windows stop accepting normal keyboard input

Open ElTopo opened this issue 7 years ago • 3 comments

I have an issue, which I am not sure if it's a wslbridge issue or mintty's, it seems to be some console connection problem.

issue: re-attached tmux windows stop accepting normal keyboard input

Versions: wslbridge version: 0.2.1 cygwin64 mintty 2.7.6 (x86_64-pc-cygwin) putty 0.68 winver: version 1703 (OS build 15063.138) aka Windows 10 Creators Update ubuntu is updated: $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.2 LTS Release: 16.04 Codename: xenial $ tmux -V tmux 2.1

How to re-create

  1. start with WSL not running (no bash.exe running in TaskManager)
  2. Open 2 mintty instances
  3. in the first mintty console, start with
tmux -f /dev/null new

to create a new tmux session, you can use Ctrl+b c to create new windows, switch between windows, run some commands in tmux windows..., tmux seems working fine note that I use -f /dev/null instead of using my .tmux.conf to avoid configuration issues. 4. now use windows' close button ([x]) on mintty's window title bar to close the first mintty console, to emulate that the mntty connection gets lost 5. now switch to the second mintty console, run

tmux -f /dev/null attach

to re-attach the running tmux session. 6. from the re-attached tmux window, type some commands. after several seconds, the tmux window stops accepting normal key input, the tmux process itself does not die and mintty still connects to WSL because you can still use Ctrl+d to exit the window, or Ctrl+b 0/1 to switch to another tmux window. Any new tmux window created by Ctrl+b c also does not accept normal key input. 7. the tmux session stays in this state till I kill the tmux server or I quit WSL totally by closing all mintty consoles.

I tried the same test with . Microsoft's original "Bash on Ubuntu on Windows" cmd console: 2 consoles, create tmux session from the first console, close the first console and re-attach tmux session from the second console, no issues. . running sshd server and connect with putty (0.68), 2 connections, create tmux session from the first ssh connection, kill the first connection by close putty window without disconnecting, then re-attach from the second connection, no issues.

ElTopo avatar Apr 20 '17 18:04 ElTopo

I'm running the same versions of software components, and I'm unable to reproduce this issue.

It sounds like wslbridge is still successfully transferring data between mintty and the WSL pty, but tmux isn't able to write input into its session ptys?

rprichard avatar Apr 22 '17 02:04 rprichard

it seems like tmux lost stdin/stdout. I just turned on tmux verbose log, there were millions of these lines:

1492880625.964822 @0 active pane not changed
1492880625.964852 event dispatch enter
1492880625.964922 %0 has 923 bytes
1492880625.964952 %0 backing off (/dev/pts/3 1723 > 512)
1492880625.964981 event dispatch exit

when tmux was in this weird state.

ElTopo avatar Apr 22 '17 19:04 ElTopo

Try the change-client command (prefix-D). That seemed to resolve this for me.

jasonnet avatar Jan 16 '18 18:01 jasonnet