Simplify tmux auto start code
that was probably actually important, and I'll regret it later
This commit is contained in:
parent
52ec61bfe5
commit
4b73e35977
14
.zshrc
14
.zshrc
@ -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
|
||||
# Attach only to the 'auto' session
|
||||
exec tmux new-session -A -s 'auto'
|
||||
fi
|
||||
|
||||
# Attach only to the prezto session
|
||||
exec tmux new-session -A -s $tmux_session
|
||||
fi
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user