tmux support

Added support for messaging only when a tmux session is detached.