if [[ $TERM != dumb && $TERM != linux && -z $STY && -z $TMUX ]]; then
# Get running detached sessions.
if [[ -z $use_tmux ]]; then
- session=$(screen -list | grep 'Detached' | awk '{ print $1; exit }')
+ session=$(screen -list | grep 'Detached' | awk '{ print $1; exit }')
else
session=$(tmux list-sessions 2>/dev/null \
| sed '/(attached)$/ d; s/^\([0-9]\{1,\}\).*$/\1/; q')
# As we exec later we have to set the title here.
if [[ -z $use_tmux ]]; then
- window_preexec "screen"
+ window_preexec "screen"
else
window_preexec "tmux"
fi
# Create a new session if none is running.
if [[ -z $session ]]; then
if [[ -z $use_tmux ]]; then
- exec screen
+ exec screen
else
exec tmux
fi
# Reattach to a running session.
else
if [[ -z $use_tmux ]]; then
- exec screen -r $session
+ exec screen -r $session
else
exec tmux attach-session -t $session
fi