Using 'cu' in an SSH Session
When the cu
program is run as terminal, the character sequence ~.
is by default used as escape sequence to terminate the program.
However, if the cu
program is run inside an SSH session and this escape sequence is typed in, the SSH session itself
is often terminated instead of the cu
program only.
The extended character sequence ~~.. can normally be used to only terminate the cu
program and keep the SSH session alive.
This works because the SSH client sees the first ~
character and then waits for the next character of a known sequence.
However, when the second ~
character arrives, this doesn't belong to a control sequence known to the SSH client, so it is forwarded
to the program running inside the session, e.g. the cu
program. Similarly the subsequent '.' character.
So the cu
program terminates and returns to the command prompt inside the SSH session, without terminating the SSH session.
— Martin Burnicki martin.burnicki@burnicki.net, last updated 2023-01-26