write used TERM to environment