Steffen Nurpmeso
2025-Oct-13  22:03 UTC
On the impossibility to use escape sequences when the networks hangs
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)
Dennis Clarke
2025-Oct-14  00:04 UTC
On the impossibility to use escape sequences when the networks hangs
On 10/13/25 18:03, Steffen Nurpmeso wrote:> Hello. > > In short: how does one control an interactive connection that > currently is incapable to send/receive data? ssh just hangs.What happens if you try : $ ssh -e\^ -l someusername remotehost I use that sort of thing all the time. The manpage says : -e escape_char Set the escape character for sessions with a pty (default: '~'). The escape character is only recognized at the beginning of a line. The escape character followed by a dot (?.?) closes the connection; followed by control-Z suspends the connection; and followed by itself sends the escape character once. Setting the character to ?none? disables any escapes and makes the session fully transparent. That escape character *should* be processed by the client side. Unless I am confused about the question. -- -- Dennis Clarke RISC-V/SPARC/PPC/ARM/CISC UNIX and Linux spoken