I'm a Windows 10 user with WSL running Debian(WLinux). I cannot suspend a ssh connection using ~^z. Other character sequences like ~. or ~? does work as expected.

  • I have no trouble to use ^z to suspend a process with a local and remote ssh session, i.e. I can execute top on a remote session and suspend it with ^z
  • same problem persists on gitbash and build-in ssh for Windows
  • stty -a returns susp = ^Z both on local and remote session
  • I have OpenSSH_7.9p1 Debian-9, OpenSSL 1.1.1b 26 Feb 2019
  • ssh config has this parameters
Host *
        ServerAliveInterval 15
        ServerAliveCountMax 3
        ControlMaster auto
        ControlPath ~/.ssh/ssh_mux_%h_%p_%r
  • 2
    Are you typing that as ~, ^ and z or as ~ followed by Ctrl-Z? The former is wrong and the latter is correct. ^X is a common way of denoting Ctrl-X for some key X. – Kusalananda Mar 22 at 10:10
  • The seqence of keys I use is ~ Ctrl z (Letter z without Shift) I don't think the key combination is wrong. If it was than I would not be able to suspend a process on a remote session, while I can do this as well (updated this in my original question). – gnom1gnom Mar 22 at 10:15
  • A workaround, if using ConEmu, is to split the screen using Ctrl+Shift+e conemu.github.io/en/SplitScreen.html – gnom1gnom Mar 22 at 11:06
  • It works OK for me on regular Debian 9 from the Windows Store, both with cmd and powershell. Can you try running, in another window, sudo strace -p thepidofssh (you might have to install strace with apt) just before you type ~^Z and see if the output looks like this when you type those chars: read(4, "~", 16384) = 1 read(4, "\32", 16384) = 1 write(2, "~^Z [suspend ssh]\r\n", 19) = 19 – Mark Plotnick Mar 22 at 16:42
  • @MarkPlotnick In the log I can only find read(6, "\32", 16384), so the read(4, "~", 16384) = 1 is missing. On the other hand I have some doubts if this should be logged separately, since ~? was logged as read(6, "~?", 16384). Anyway, there is no indication of [suspend ssh] – gnom1gnom Mar 25 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.