From d0b7d1074fa27f95a181a95f59aa523a37afa7fe Mon Sep 17 00:00:00 2001
From: Antonio Ragagnin <antonio.ragagnin@inaf.it>
Date: Sat, 11 Jan 2025 18:43:15 +0100
Subject: [PATCH] fix clone

---
 cloneall.bash | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/cloneall.bash b/cloneall.bash
index d5a8d61..08cf0f6 100755
--- a/cloneall.bash
+++ b/cloneall.bash
@@ -63,19 +63,23 @@ if [ ! -z "$tmuxa" ]; then
     
     if ! tmux has-session -t $SESSION_NAME ; then
 	# Create a new tmux session
-	tmux new-session -d -s $SESSION_NAME -c $PWD
 
 	[[ -d full ]] && REPOS+=(full)
 	
 	for index in "${!REPOS[@]}"; do
             value="${REPOS[index]}"
 	    
+	    if [[ "$index" == 0 ]]; then
+		tmux new-session -d -s $SESSION_NAME -c $PWD
+	    else
+		tmux new-window -t $SESSION_NAME -c $PWD
+	    fi
             # Initialize the environment in the first window
             tmux send-keys -t $SESSION_NAME:$index ". .env" C-m
             tmux send-keys -t $SESSION_NAME:$index ". venv/bin/activate" C-m
             tmux send-keys -t $SESSION_NAME:$index "cd $PWD/$value" C-m
 	    tmux rename-window $value
-            tmux new-window -t $SESSION_NAME -c $PWD
+            
 	done
     fi
     tmux attach-session -t $SESSION_NAME
-- 
GitLab