I would like to configure the terminal type by detecting it. For example when I am connecting to a Solaris box with PuTTY, the $TERM variable is set to vt100. I would like to negotiate this so, when the terminal emulator is PuTTY, to set $TERM to xterm.
I've noticed that at ^E PuTTY answers back with PuTTY. But I think that the best method is to use tput to try to detect the terminal emulator type. The problem is that I could not find any reference in the terminfo or tput manual how to do this.
Otherwise I will try with something based on:
unset remote_term;echo $'\cE';read -rt 1 -n5 remote_term ;echo remote_term=$remote_term