diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index aa8ebfb..1d3cfcb 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -104,7 +104,9 @@ if command -v startx &>/dev/null && [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]]; then fi # 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)" if (( ! num_sessions )); then