Screen not setting $TERM to screen

gnu-screenterminfo

I have a problem with gnu screen.

Computer 1:

open terminal
$ printenv TERM
xterm-color
$ screen
$ printenv TERM
screen

Computer 2:

open terminal
$ printenv TERM
xterm-color
$ screen
$ printenv TERM
xterm-color

Both computers are running Mac OS X 10.6.4, screen version 4.00.03, and similar configuration.

According to screen its man page:

In each window's environment screen
opens, the $TERM variable is set to
"screen" by default. But when no
description for "screen" is installed
in the local termcap or terminfo data
base, you set $TERM to – say –
"vt100".

In both computers I have the terminfo files for "screen" at /opt/local/share/terminfo/73

Even when I do screen -T screen I still get the $TERM variable set as xterm-color

Any ideas?

Best Answer

It's most likely being overwritten in ~/.bashrc. That's the case on my system. I added the following line to the top of my ~/.bashrc:

echo $TERM >> /tmp/bashrc.out

then started screen and did this:

$ cat /tmp/bashrc.out
screen
$ echo $TERM
xterm-256color
$ grep -n TERM ~/.bashrc
1:echo $TERM >> /tmp/bashrc.out
33:export TERM=xterm-256color