You can look at the $TERM variable.
echo $TERM
If it's a screen session, the term variable should return "screen".
root@deore:/volumes# echo $TERM screen Ctrl-a -d (to exit screen)
root@deore:/volumes# echo $TERM xterm Also check: http://stackoverflow.com/questions/3472287/how-do-you-tell-if-the-current-terminal-session-is-in-gnu-screenhttps://stackoverflow.com/questions/3472287/how-do-you-tell-if-the-current-terminal-session-is-in-gnu-screen