summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.zlogin21
1 files changed, 16 insertions, 5 deletions
diff --git a/.zlogin b/.zlogin
index 145a154..968ec25 100644
--- a/.zlogin
+++ b/.zlogin
@@ -1,9 +1,20 @@
-cmd_exists screen && screen -list | strings | grep -v "^No Sockets found" > .tmp.screen-list
-[ -s .tmp.screen-list ] \
-&& preprint "screen" $color[bold] && echo \
-&& < .tmp.screen-list
-[ -e .tmp.screen-list ] && rm -f .tmp.screen-list
+:>.tmp.screen-list
+if cmd_exists tmux
+then
+ session_manager=tmux
+ tmux list-sessions | strings > .tmp.screen-list
+elif cmd_exists screen
+then
+ session_manager=screen
+ screen -list | strings | grep -v "^No Sockets found" >> .tmp.screen-list
+fi
+if [ -s .tmp.screen-list ]
+then
+ preprint "$session_manager" $color[bold] && echo
+ < .tmp.screen-list
+ rm -f .tmp.screen-list
+fi
cmd_exists keychain && eval $(keychain --eval --inherit any-once --quick)