List tmux sessions when starting zsh login shells

This commit is contained in:
Eryn Wells 2013-01-07 09:51:43 -08:00
parent e9de60c438
commit 7bb6389571

View file

@ -9,7 +9,19 @@ print_heading -l 1 'Initializing login shell'
[ -e $HOME/.profile ] && source $HOME/.profile
# Any ZSH stuff goes here.
list_tmux_sessions()
{
tmux_out=`tmux list-sessions 2>/dev/null`
[[ -z "$tmux_out" ]] && return
echo "You have the following active tmux sessions:"
for session in ${(f)tmux_out}; do
echo " $session"
done
echo
}
list_tmux_sessions
[ -e $HOME/.profile.$SYS ] && source $HOME/.profile.$SYS
[ -e $HOME/.profile.local ] && source $HOME/.profile.local