# through ssh.
if [[ $TERM != dumb && $TERM != linux && -z $STY && -z $TMUX ]]; then
# Get running detached sessions.
# through ssh.
if [[ $TERM != dumb && $TERM != linux && -z $STY && -z $TMUX ]]; then
# Get running detached sessions.
session=$(tmux list-sessions 2>/dev/null \
| sed '/(attached)$/ d; s/^\([0-9]\{1,\}\).*$/\1/; q')
fi
# As we exec later we have to set the title here.
session=$(tmux list-sessions 2>/dev/null \
| sed '/(attached)$/ d; s/^\([0-9]\{1,\}\).*$/\1/; q')
fi
# As we exec later we have to set the title here.