When an ssh session is forcibly disconnected, readline breaks (mac)

0

On Mac's iTerm app, when I ssh into remote machines and the connection is terminated by either power loss or connection failure, some of the time, readline in the terminal fails. At least, I think it's readline - the main symptom is that history-search-backward and history-search-forward no longer function. The part I can't understand is that it is broken on both the local and remote machines even after establishing a new connection. The other strange part is that the failure only happens some of the time, not every time I get disconnected.

I think this could be a problem with ssh, mac's terminal, or just the iTerm app, but I have no idea where to start looking. Any ideas would be appreciated, but with such a convoluted problem I can't really expect any solutions.

keflavich

Posted 2011-11-13T16:42:48.077

Reputation: 373

This is not a programming related question. Superuser or askdifferent would be a better option. – Ikke – 2011-11-13T16:47:20.967

2Not sure what you're experiencing, but I suspect your terminal settings are getting thrown off by the way your ssh gets killed. Try typing "reset" in your terminal as a possible fix. – bigendian – 2011-11-13T17:13:32.663

Thanks, reset fixed it - is that documented anywhere? – keflavich – 2011-11-14T05:14:10.850

@Ikke: I flagged this post to be moved to superuser – keflavich – 2011-11-14T15:49:45.267

@bigendian - That's the solution. Is it documented anywhere? I'll accept it as an answer if you post it. I'm still curious why in case anyone else has a thought... – keflavich – 2011-12-02T21:14:40.747

Answers

1

Your terminal settings are being through off by something, and the reset command can be used to fix them.

I'm actually not sure why this happens, but I suspect that some binary may be getting passed to the shell which is interpreting it as control codes that change how your shell operates.

bigendian

Posted 2011-11-13T16:42:48.077

Reputation: 126