#!/usr/bin/env bash
# Stop the sx-primitives tmux session.
set -euo pipefail

SESSION="sx-primitives"

if tmux has-session -t "$SESSION" 2>/dev/null; then
  tmux send-keys -t "$SESSION:primitives" "/exit" C-m 2>/dev/null || true
  echo "Sent /exit. Waiting 5s..."
  sleep 5
  tmux kill-session -t "$SESSION"
  echo "Killed tmux session '$SESSION'."
else
  echo "No $SESSION tmux session running."
fi
