I have tried to use:
Terminal Profiles > Default > When idle sends ascii code
as a keepalive solution using various values in this field (such as '0',
'20', and others) but they all seem to create problems. For example, if I
use '20', then:
- if I have vim open, I get things like "E73: tag stack empty" if the
terminal is idle
- if I am using 'tail -f <file>', ^T chars keep getting printed to the
terminal
Every other code I have tried has had one problem or another, all of which
interfere with my ability to use iTerm effectively.
The question posed was: "What do you suggest we send?"
My response is....I have no idea what should be sent....but other applications seem to be able to maintain their connections without causing problems like this. For example, this doesn't happen to me with PuTTY on Windows. Anyway, this is the ONLY thing that bothers me about iTerm.....I love it otherwise. Thanks!
I think you're going about this the wrong way. Local terminals shouldn't need to be kept alive. If what you're trying to do is keep an SSH connection from freezing (I have this problem at my university) what needs changing is your .ssh/config. Specifically, add these four lines:
Host *
ServerAliveCountMax 3
ServerAliveInterval 10
TCPKeepAlive yes
The first line specifies that this applies to all hosts (so if you already have a Host * section, just add the bottom three lines to that). The second and third specify that SSH2 keepalive messages should be sent every 10 seconds during periods of inactivity, and to consider the connection dead after 3 non-responses to those messages. The last line enables TCP transport-layer keepalive messages (which were the only keepalive method available in SSH1, but I find isn't quite enough in SSH2).
Thanks phoenix-frozen....your suggestion has worked wonderfully!
Thanks phoenix-frozen....your suggestion has worked wonderfully!