Simplify tmux auto start code

that was probably actually important, and I'll regret it later
This commit is contained in:
Adam Goldsmith 2016-12-02 12:49:33 -05:00
parent 52ec61bfe5
commit 4b73e35977
1 changed files with 6 additions and 12 deletions

18
.zshrc
View File

@ -43,18 +43,12 @@ unalias run-help
autoload run-help
# Auto start tmux if a remote connection
if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" ]] && [[ -n "$SSH_TTY" ]]
if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" && -n "$SSH_TTY" ]]
then
tmux_session='zim'
tmux start-server
# Create a 'prezto' session if no session has been defined in tmux.conf.
if ! tmux has-session 2> /dev/null; then
tmux \
new-session -d -s "$tmux_session" \; \
set-option -t "$tmux_session" destroy-unattached off &> /dev/null
fi
# Attach only to the prezto session
exec tmux new-session -A -s $tmux_session
# Attach only to the 'auto' session
exec tmux new-session -A -s 'auto'
fi
fi