diff .zshrc @ 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 62bfb554ab85
children c7e8311eb2ba
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