Yep, as I wrote below another comment, I share the same sentiment. To mitigate the risk somewhat, I tend to press Ctrl-C a few times before hitting enter to initiate the escape sequence (there are some edge cases where you need more than one Ctrl-C to interrupt).
Still not satisfied about it, as there are plenty of situations where that doesn't help. Being in emacs, for example, it could make things worse...
cough accidently sending half-pasted gibberish to IRC.
My most frequently posted line in IRC is
:wqAnd slack. And hipchat. And google docs. And Sublime Text. And...:wq
Try switching to
ZZ
Doesn't require a CR and therefore less likely to be submitted accidentally.I'm aware of ZZ and use it occasionally, but I can't get my muscle memory from "occasionally" to "consistently".
My solution is to use a stateless in-application (where I expect to be) command to switch to a different window (In this case, the server chatter window) where pasting the line is an error since there's no command.
It usually works...
I agree that it would be nice if /any/ terminal escape sequence followed by ~ would initiate the escape.
You don't need to press enter you can just use ^D.
Re:SSH Escape Sequences
by peterwwillis on Tuesday October 24, 2017 @12:22AM
(#15539201)
Always use Ctrl+C Enter ~. Enter. Just think of it as an ssh Konami code.
If you've sshed into another box first, use ~~. to only reset the embedded session.
^E^U<enter> standard practice.
It's TCP so the connection either breaks or arrives in order.
How about typing "Ctrl+C Ctrl+C e x i t Enter", and then adding the "~ ." if that doesn't work?
Re:SSH Escape Sequences
by phillipwills on Tuesday October 24, 2017 @01:28AM
(#15539436)
I've posted random ~. in irc because I did it in the wrong order...
In the edge-case scenario of a glitchy link that appears frozen, it's entirely possible that my Enter keypress might actually make it through and then do something I don't want.
I've had mouse and keyboard input get through to seemingly-frozen VNC sessions, so...