zsh:zprofile: Attach to tmux only when it exists
This commit is contained in:
@@ -104,7 +104,9 @@ if command -v startx &>/dev/null && [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Attach to tmux session if connected over ssh and not already attached
|
# Attach to tmux session if connected over ssh and not already attached
|
||||||
if [[ (-n $SSH_CLIENT || -n $SSH_TTY || -n $SSH_CONNECTION) && -z $TMUX ]]; then
|
if (( $+commands[tmux] )) &&
|
||||||
|
[[ (-n $SSH_CLIENT || -n $SSH_TTY || -n $SSH_CONNECTION) && -z $TMUX ]]
|
||||||
|
then
|
||||||
num_sessions="$(tmux list-sessions 2>/dev/null | wc -l)"
|
num_sessions="$(tmux list-sessions 2>/dev/null | wc -l)"
|
||||||
|
|
||||||
if (( ! num_sessions )); then
|
if (( ! num_sessions )); then
|
||||||
|
|||||||
Reference in New Issue
Block a user