On my local terminal, I have TERM=konsole-256color, but not all remote machine I connect to have this definition.
Is it possible to make ssh change the TERM on remote machine? Without changing .bash* scripts on remote machine, just by changing configuration on my local desktop?
I have added the following alias to my .bashrc file. It uses O G's answer but wraps it in an alias. Works like a charm ;)
man ssh:
Edit:
Rats, I hoped it could be on the local side, still, if there's a will, there's a way. man ssh_conf:
Depending on the configuration of sshd on the receiving end this may or may not fulfil the requirement of "no remote file modification".
On remote, execute echo $TERM.
On 2021-06-04, "allow ssh_config SetEnv to override $TERM" was committed to openssh-portable, which sounds like it will let you set
SetEnv TERM
in~/.ssh/config
, such as in aHost
directive. (Or it will let you as soon as a release is cut with this patch, presumably.)Here's my quick and dirty solution I just threw together. I'd prefer something better. I guess I could use a shell script instead. Adjusting
TERM
values is left as an exercise to the reader.Ideally, it would do something like check the TERMs on the other side, using the
ControlPersist
stuff to prevent long delays for multiple connections.