问题原文
原帖链接 · Igor Liferenko · CC BY-SA 4.0
I use this setting in ~/.ssh/config:
Host server
Hostname 192.168.x.x
SetEnv TERM=xterm
But when logging in to the server and doing echo $TERM, I get xterm-256color.
How to set TERM from ssh client config file?
What is curious: when connecting as TERM=xterm ssh server, echo $TERM on server gives xterm. Although this shows that the setting can be transmitted, it does not solve the problem, because I need to set it in config file. Also, putting TERM=xterm in .ssh/environment on server sets it, but it does not solve the problem either, because I cannot edit anything on server.
社区高分解答
原帖链接 · Slim · CC BY-SA 4.0
Since OpenSSH 8.7 (2021-08-20), SetEnv TERM is now supported:
allow ssh_config SetEnv to override $TERM, which is otherwise handled specially by the protocol. Useful in ~/.ssh/config to set TERM to something generic (e.g. "xterm" instead of "xterm-256color") for destinations that lack terminfo entries.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
