On the impossibility to use escape sequences when the networks hangs
Noah Zalev
noah at zalev.ca
Fri Oct 17 03:28:07 AEDT 2025
I think I understand your point of confusion. From my reading, it seems as
though you are under the impression that the escape sequence must be entered at
"the beginning of a line", meaning it would line up like so:
noah at svr:~$ foo b
----------- ^
You wrote, "You can also not backspace back until you think you surely reached
the start of the line, then RETURN ..."
Your assumption here is not correct though. You do not need to navigate
yourself "to the beginning of the line". The escape simply has to follow a
newline. That is to say, you can be in the middle of a line, and hitting Enter
to put a newline character into the buffer, followed by ~. will cause the client
to disconnect. This is processed client-side so the state of the network is
irrelevant.
I understand that in the state of a network interruption, the characters you
enter will not be echoed back at you, but this is not required. The SSH client
will process the input anyway.
For the purpose of giving you an example, I have induced a network interruption:
noah at svr:~$ foo bConnection to -----.ca closed.
noah at T490:~$
I disconnected by hitting Enter, and followed it with ~.
Because there is no network connection, you will not see anything echoed back,
but this doesn't matter. You can even continue typing "abc...xyz" prior to
"[Enter]~." You will not see it echoed, but the client is still processing it.
With respect to this "^C" business, put it out of your mind. You want ~.
On Thu, 16 Oct 2025 02:03:38 +0200
Steffen Nurpmeso <steffen at sdaoden.eu> wrote:
> But this only works at the beginning of a line.
> Only then the client turns this mechanism "hot".
> This condition requires that the network gets stuck at exactly
> that time, directly after i hit a newline,
> In the end this is why i asked. The network stuck, and my
> terminal did, too. You can also not backspace back "like grazy"
> until you think you surely reached the start of the line, then hit
> RETURN for newline, to hotten the trigger, since all that is
> only line processing by the shell on the server side.
--
Noah Zalev
More information about the openssh-unix-dev
mailing list