I agree that it "should", but I've definitely had it not work. It may actually be a problem with the state of my local terminal under macOS. I've had to resort to "kill -9"ing my ssh from another window in some situations.
I can only imagine it appearing it not working by hitting Ctrl-s, which freezes terminal output. Killing ssh wouldn't solve that though. Besides unfreezing it with Ctrl-q, you'd have to kill the whole terminal.
Comments
~? gets you a list of options ~. terminates the connection
Sometimes plain ~. just doesn't work, depending on what state your connection is in.
~<Ctrl-Z> should suspend the ssh process and drop you back in the shell, where you can "kill %1".
I can't imagine what state that would be. It should work even if the remote machine is completely unresponsive.
I agree that it "should", but I've definitely had it not work. It may actually be a problem with the state of my local terminal under macOS. I've had to resort to "kill -9"ing my ssh from another window in some situations.
I can only imagine it appearing it not working by hitting Ctrl-s, which freezes terminal output. Killing ssh wouldn't solve that though. Besides unfreezing it with Ctrl-q, you'd have to kill the whole terminal.