Detecting if Your Shell is Running in GNU Screen
You sometimes need to know whether your shell is running inside screen or tmux. The most straightforward approach is checking the TERM environment variable. Using TERM When screen starts a shell, it sets TERM=screen by default: [user@host ~]$ echo $TERM screen Compare this to a normal terminal session: [user@host ~]$ echo $TERM xterm-256color The TERM…