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
18
.zshrc
18
.zshrc
@ -43,18 +43,12 @@ unalias run-help
|
|||||||
autoload run-help
|
autoload run-help
|
||||||
|
|
||||||
# Auto start tmux if a remote connection
|
# 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
|
then
|
||||||
tmux_session='zim'
|
# Attach only to the 'auto' session
|
||||||
tmux start-server
|
exec tmux new-session -A -s 'auto'
|
||||||
# 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
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user