fix: drop osascript, use universal ! tmux attach approach

This commit is contained in:
2026-03-27 12:53:26 -04:00
parent 4a6ddaa193
commit 5e456cff6d

View File

@@ -113,25 +113,17 @@ LOOP_CMD=".loop/loop.sh"
tmux kill-session -t agent-loop 2>/dev/null; tmux new-session -d -s agent-loop -c <project_root> "$LOOP_CMD" tmux kill-session -t agent-loop 2>/dev/null; tmux new-session -d -s agent-loop -c <project_root> "$LOOP_CMD"
``` ```
7. Open the tmux session for the user. Try platform-specific methods: 7. Tell the user:
**macOS** (check `uname` = Darwin): > **Loop launched.** Watch it live:
```bash > ```
osascript -e 'tell application "Terminal" to do script "tmux attach -t agent-loop"' > ! tmux attach -t agent-loop
``` > ```
> (Type the above — it opens the session right here in your terminal.)
**Linux/other** — cannot open a terminal programmatically. Tell the user: >
``` > - **Detach** (return to Claude Code): `Ctrl+B` then `D`
! tmux attach -t agent-loop > - **Stop the loop**: `Ctrl+C`
``` > - Ask me "status" anytime and I'll check progress.
8. Tell the user:
> **Loop launched.**
> - **Detach** (keep loop running): `Ctrl+B` then `D`
> - **Stop the loop**: `Ctrl+C` in the tmux window
> - **Reattach later**: `tmux attach -t agent-loop`
> - Ask me "status" anytime and I'll check progress for you.
--- ---