On the impossibility to use escape sequences when the networks hangs

Steffen Nurpmeso steffen at sdaoden.eu
Tue Oct 14 09:03:28 AEDT 2025


Hello.

In short: how does one control an interactive connection that
currently is incapable to send/receive data?  ssh just hangs.
This means that ^Z does not work, nor does ^C, but even if,
the ~ escape sequence mechanism does not work if a new prompt
reappears after a ^C, you really need an empty line at minimum,
aka pass though a RETURN hit.

  $ ssh root at kent
  Last login: Mon Oct 13 23:43:24 2025 from 203.0.113.1
  #?0|kent:~# echo para^C
  #?130|kent:~# ~#
  -bash: ~#: command not found
  #?127|kent:~#
  The following connections are open:
    #0 client-session (t4 [session] r0 nm0 i0/0 o0/0 e[write]/4 fd 4/5/6 sock -1 cc -1 nc0 io 0x01/0x01 RTI)

The only option one has in such a sitation is another terminal,
and kill(1)ing ssh?

An inconsistency: as ^Z does not work (likely terminal mode
setting thus, which i find unfortunate to an interactive program),

  #?0|kent:$ ssh root at kent
  Last login: Mon Oct 13 23:57:08 2025 from 203.0.113.1
  #?0|kent:~# ^C
  #?130|kent:~# ^C
  #?130|kent:~# ^C
  #?130|kent:~#

^C "just ok"

  #?130|kent:~#
  [1]+  Stopped                    ssh root at kent

^ "kill -TSTP 22427" in another window

  #?148|kent:$
  #?148|kent:$ fg
  ssh root at kent


  #?130|kent:~# ^CConnection to kent closed.

^ The next ^C "is not ok" -- it should not affect the ssh session
in a way different to before?
This is on self-compiled glibc-based Linux

  $ ssh -V
  OpenSSH_10.2p1, OpenSSL 3.5.4 30 Sep 2025

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


More information about the openssh-unix-dev mailing list