Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I use ssh, I notice that my TERM variable is forwarded automatically. This is quite useful, but I'm wondering what other variables are forwarded or set. So far I've found the following information:

  • The ssh man page lists several variables that are set, none of which is TERM.
  • My local /etc/ssh/ssh_config has several SendEnv commands, none of which mention TERM.
  • The remote .zshenv, /etc/zshenv, etc. files don't mention TERM and wouldn't be able to forward it without the cooperation of the local machine anyway.
  • I have no ~/.ssh/environment file on the remote machine, or ~/.ssh/config file on either machine (I find that ssh works almost the way I want straight out of the box). Again, even if I did have this file, it wouldn't be able to forward TERM without my local machine's help.
  • When I run ssh without specifying a command, the TERM environment variable is forwarded (and if I set it to something else locally before running ssh, the new value is forwarded; it's not just being set to a constant).
  • When I run ssh and specify a command (e.g., ssh remote-host env), the TERM environment variable is not set.

So, my question basically has two parts. The first is, where is TERM being set, and why can't I find any documentation indicating this (and, on a related note, if I for some reason did not want to forward TERM, how would I stop this)? The second, related, part is what other environment variables are being set that aren't mentioned in the ssh man page or the various configuration files I mentioned?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.