-1

By default, Putty identifies itself as "xterm" terminal type, but it's possible to change its settings so it identifies itself as "xterm-256colors".

As far as I understand, this is done by setting "$TERM" variable.

The problem is that this requires every individual user to change their Putty configurations one by one.

To eliminate that, I am considering forcing every user to have "xterm-256colors" $TERM value centrally (e.g. via .login).

Assuming that every user uses a terminal program which supports "xterm-256colors", is there any difference whatsoever between doing this from the Unix side directly instead of from the terminal program? (I'm mostly looking for possible issues/downsides).

DVK
  • 321

1 Answers1

1

There is no difference between setting the value explicitly or letting the terminal program set the value; both result in the TERM variable getting set. That said, letting the terminal program set the value is the best way to get a sane setting – the terminal knows the terminal type it supports. If the terminal doesn't support the specified terminal type, then it's hard to predict what the output will look like when rendered by the terminal.

As @JdeBP points out in the comments, the values used by putty and xterm differ; it is not safe to assume that everything will support xterm-256.

Andy Dalton
  • 13,993
  • infocmp xterm-256color putty-256color will tell you that there are a lot more differences than that. – JdeBP Jan 23 '18 at 06:53
  • Note that I was addressing the question of "is there a difference between setting TERM directly instead of from the terminal program" and not addresses any differences between specific terminal types. – Andy Dalton Jan 23 '18 at 15:00
  • By claiming that the main difference will be that colour control sequences will display as "garbage". Ironically, that won't really happen, and one of the actual main differences is in fact something that turned up within hours of this very answer at https://unix.stackexchange.com/questions/419068/ , as revealed by infocmp as I said. – JdeBP Jan 23 '18 at 19:16
  • @JdeBP You're right, that portion of my answer was wrong/misleading -- thank you. I've updated my answer to try to make it more correct. – Andy Dalton Jan 23 '18 at 19:44