Tente isto:
if [ "${TERM}" == "screen" ]
then
# Set prompt to something special for screen.
fi
Esta é a citação relevante da página de manual da tela :
term term
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". This won't do much harm, as screen is VT100/ANSI compatible. The use of the "term"
command is discouraged for non-default purpose. That is, one may want to specify special $TERM settings (e.g. vt100) for the next "screen rlogin otherma-
chine" command. Use the command "screen -T vt100 rlogin othermachine" rather than setting and resetting the default.