Only start tmux if there is no client currently attached
This commit is contained in:
parent
7ef46e75eb
commit
5d230abfd7
5
.zshrc
5
.zshrc
@ -17,7 +17,10 @@ if [[ -f "$oh_my_zsh/oh-my-zsh.sh" ]]; then
|
||||
)
|
||||
|
||||
if [[ $(command -v tmux) ]]; then
|
||||
if [[ ! -v "ZSH_TMUX_AUTOSTART" ]]; then export ZSH_TMUX_AUTOSTART=true; fi
|
||||
# Only start/attach if no existing session with client.
|
||||
if [[ (( $(tmux list-sessions -F "#{session_attached}" 2>/dev/null || echo 0) = 0 )) && ! -v "ZSH_TMUX_AUTOSTART" ]]; then
|
||||
export ZSH_TMUX_AUTOSTART=true
|
||||
fi
|
||||
plugins+=(tmux)
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user