Check if tmux is available with command -v

This commit is contained in:
gardouille 2021-09-18 23:05:54 +02:00
parent 0eb42f0ea3
commit 5086ba686d
Signed by: gardouille
GPG Key ID: E759BAA22501AF32
1 changed files with 1 additions and 1 deletions

2
zlogin
View File

@ -41,7 +41,7 @@ if [ -f ~/.ssh/config_00base ]; then
fi
# List tmux sessions if tmux is available
if hash tmux; then
if [ $(command -v tmux) ]; then
TMUX_SESSION=$(tmux ls 2> /dev/null|grep -- window)
# If tmux session available and if not already inside a tmux
if [ ${TMUX_SESSION} ] && [ -z "${TMUX}" ]; then