start-tmux: check if session is interactive

This commit is contained in:
Michael Grote 2024-09-13 18:24:48 +02:00
parent b053416615
commit 869f4c26fc

View file

@ -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