feat: add check for exactly one active tmux window

This commit is contained in:
Paul Gauthier (aider) 2025-03-18 11:50:12 -07:00
parent 89c9290602
commit 4cf9679334

View file

@ -1,5 +1,12 @@
#!/bin/bash #!/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) # Get tmux window size (width x height)
TMUX_SIZE=$(tmux display -p '#{window_width}x#{window_height}') TMUX_SIZE=$(tmux display -p '#{window_width}x#{window_height}')