changeset 278:c65cc71d7ba1

zshrc: add a tmux variant of the detached screens message
author Augie Fackler <raf@durin42.com>
date Fri, 27 Apr 2012 16:50:58 -0500
parents 884f7f932a83
children 0b718e51de16
files .zshrc
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/.zshrc
+++ b/.zshrc
@@ -19,6 +19,19 @@ if [ ! "$SHOWED_SCREEN_MESSAGE" = "true"
         export SHOWED_SCREEN_MESSAGE="true"
 fi
 
+if [ ! "$SHOWED_TMUX_MESSAGE" = "true" ]; then
+  if which tmux > /dev/null; then
+    detached_screens=$(tmux ls | grep -v attached)
+    if [ ! -z "$detached_screens" ]; then
+      echo "+-----------------------------------------------------------+"
+      echo "| Detached tmux sessions are available:                     |"
+      echo "$detached_screens"
+      echo "+-----------------------------------------------------------+"
+    fi
+  fi
+  export SHOWED_TMUX_MESSAGE="true"
+fi
+
 # If available, source private extensions stored in a different repo
 if [[ -a ~/.private/zshrc ]]; then
     source ~/.private/zshrc