From 45a931035179c6e13e8727b5cdd85161471f7ed6 Mon Sep 17 00:00:00 2001
From: Jelle van der Waa <jelle@archlinux.org>
Date: Mon, 23 Nov 2020 21:37:51 +0100
Subject: [PATCH] Rework tmux dev setup spawning

Remove the unrequired -2 option when attaching a tmux session. Get rid
of the warning when selecting the window by providing the missing + and
remove the unrequired split-window.
---
 scripts/startdevelop.sh | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/scripts/startdevelop.sh b/scripts/startdevelop.sh
index 5ca6aa8..37ba930 100755
--- a/scripts/startdevelop.sh
+++ b/scripts/startdevelop.sh
@@ -8,19 +8,17 @@ tmux new-session -d -s ${SESSION}
 
 # Setup panes
 tmux new-window -t ${SESSION}:0 -n "${SESSION}"
-tmux split-window -v
-tmux select-pane -t 0
 tmux send-keys "make js-watcher" C-m
+tmux split-window -v
 tmux select-pane -t 1
 tmux send-keys "make sass-watcher" C-m
 tmux split-window -v
 tmux select-pane -t 2
 tmux send-keys "caddy" C-m
 
-
 # Set default window
-tmux select-window -t $SESSION:1
+tmux select-window -t $SESSION:+1
 
 # Attach to session
-tmux -2 attach-session -t $SESSION
+tmux attach-session -t $SESSION
 
-- 
GitLab