From 4cf9679334feae6f6b29bed8516e60c06598b369 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 18 Mar 2025 11:50:12 -0700 Subject: [PATCH] feat: add check for exactly one active tmux window --- scripts/tmux_record.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/tmux_record.sh b/scripts/tmux_record.sh index 0051153d5..d0ecf64f4 100644 --- a/scripts/tmux_record.sh +++ b/scripts/tmux_record.sh @@ -1,5 +1,12 @@ #!/bin/bash +# Check if there is exactly one active window +WINDOW_COUNT=$(tmux list-windows | wc -l) +if [ "$WINDOW_COUNT" -ne 1 ]; then + echo "Error: Expected exactly 1 tmux window, found $WINDOW_COUNT windows." + exit 1 +fi + # Get tmux window size (width x height) TMUX_SIZE=$(tmux display -p '#{window_width}x#{window_height}')