Check $TMUX variable to see if we're in a tmux session before printing list

This commit is contained in:
Eryn Wells 2013-03-12 14:01:55 -07:00
parent f90198bf2b
commit 1f8f5e3a9f

View file

@ -12,7 +12,7 @@ print_heading -l 1 'Initializing login shell'
list_tmux_sessions()
{
tmux_out=`tmux list-sessions 2>/dev/null`
[[ -z "$tmux_out" ]] && return
[[ -z "$tmux_out" || -n "$TMUX" ]] && return
echo "You have the following active tmux sessions:"
for session in ${(f)tmux_out}; do