1

When I'm connection to a remote server via ssh inside a Terminal window, and I put the computer to sleep, when I come back the connection is of course interrupted. The problem is there seems to be no way to resurrect the window and its associated local bash prompt. All I really care about is re-using the Terminal window. I don't want to have to do command+N which opens a tiny window, and have to resize it, and position it on the screen, etc. Shouldn't there be some way to use the same window and local shell? I would kind of expect a sleep action to cause the ssh program to drop back to a local bash prompt, so I don't understand why the window seems to be completely dead.

1

3 Answers 3

6

Press Enter ~ . to terminate a SSH session.

(~ is ssh's escape character, and it only works after a new-line.)

0
4

What happens if you use Ctrl-C? The other option would be to create a new tab, rather than a new window by using Command-T instead of Command-N. And another option on top of that would be to open a new tab, use the killall command to force SSH to end, and then close the new tab.

2
  • killall ssh is my usual fix for this. Oct 5, 2010 at 18:34
  • ctrl+c didn't fix it. Or maybe it did, but took awhile. In any case, it appears killing it does the trick.
    – Eddified
    Oct 6, 2010 at 5:08
1

wait a few minutes and you'll get the prompt back. If you don't want to wait, you can copy and paste the screen to a text file, open a new terminal tab/window and cat the file. (You'll lose the colours though)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .