From 6aef93854afd642dd455dc61c32c8e0f1f1fca41 Mon Sep 17 00:00:00 2001 From: anakha Date: Thu, 14 Jul 2022 06:36:56 -0400 Subject: [PATCH] fix multiple instances running --- tmux-autoreload.tmux | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tmux-autoreload.tmux b/tmux-autoreload.tmux index 0ab882d..81e9308 100755 --- a/tmux-autoreload.tmux +++ b/tmux-autoreload.tmux @@ -248,6 +248,11 @@ function main() { tmux set-option -g "@$name-pid" $$ + # force cleanup + for KILLPID in `ps ax | grep "entr.*tmux-autoreload" | grep -iv "grep" | awk '{print $1;}'`; do + kill $KILLPID; + done + # shellcheck disable=2016 entr -np sh -c '"$0" -r "$1"' "$self" /_ <<<"$(printf '%s\n' "$(get_base_configs)" "$(get_user_configs)")" & # shellcheck disable=2064