Skip to content

Commit

Permalink
fix: reduce sleep time to prevent session conflicts
Browse files Browse the repository at this point in the history
Generated-by: aiautocommit
  • Loading branch information
iloveitaly committed Nov 21, 2024
1 parent 1944b47 commit fe0af19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .tmux-shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ counter=0
# tmux converts periods to _
session_uid="${session_uid//./_}"

sleep 1
# prevent conflicts when multiple shell sessions are opening at the same time
sleep 0.2

while [[ $counter -lt 20 ]]; do
session="${session_uid}-${counter}"

# if the session doesn't exist, create it
if ! tmux has-session -t "$session" 2> /dev/null; then
if ! tmux has-session -t "$session" 2>/dev/null; then
tmux new -ADs "$session"
break
fi
Expand Down
1 change: 0 additions & 1 deletion install/server-exclude.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.alacritty.yml
.tmux.conf
.tmux-shell.sh
.asdfrc
.ssh
mackup.cfg
.config/karabiner/
Expand Down

0 comments on commit fe0af19

Please sign in to comment.