I often have SSH connections through Terminal that stop responding (like if I've left it overnight) but when I try to use the dead connection Terminal doesn't respond for several minutes until:

Write failed: Broken pipe

Is there a way I can tell bash to immediately disconnect (because I know the connection is dead) without closing/opening a new window?

  • Does CTRL+C not work for that? – anguiac7 Nov 26 '14 at 5:16
  • Agreed. CTRL+C should work. – Jerry W. Nov 26 '14 at 11:15
  • Should of mentioned that CTRL+C and CTRL+D do not work. – Elliot Chance Nov 26 '14 at 23:21
  • Control characters only send a signal to the application to be handled by the application. If the connection is dead the character waits to be sent like any other character typed. – Elliot Chance Nov 26 '14 at 23:22

You can type


which ends the SSH connection. Normally it works immediately, but sometimes you may need to do it a few times.

  • Worked perfectly first time for me :) – Elliot Chance Nov 26 '14 at 23:23

You must log in to answer this question.

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