From 869f4c26fc74dfcd02a16c7249e580f3855eb911 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Fri, 13 Sep 2024 18:24:48 +0200 Subject: [PATCH] start-tmux: check if session is interactive --- start_tmux.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/start_tmux.sh b/start_tmux.sh index eabaf1b..74689a9 100755 --- a/start_tmux.sh +++ b/start_tmux.sh @@ -1,3 +1,6 @@ #!/bin/bash -tmux new-session -s ansible-devspace -d -tmux attach -t ansible-devspace +## check interactive shell https://unix.stackexchange.com/questions/26676/how-to-check-if-a-shell-is-login-interactive-batch +if [[ $- == *i* ]] ; then + tmux new-session -s ansible-devspace -d + tmux attach -t ansible-devspace +fi