Problem
Calling spawn_agent opens the child pi session with tmux new-window, which selects the new window by default. The parent session is therefore switched away to the child's window on every spawn, disrupting the parent's context.
Expected behavior
Spawning a subagent should stay fire-and-forget: the new window should be created in the background and the parent should remain in its own window. The parent already receives the report asynchronously via the result socket, so there is no reason to focus the child.
Fix
Pass -d (--no-select) to tmux new-window in spawn() in index.ts, so the new window does not become the current window.
Problem
Calling
spawn_agentopens the child pi session withtmux new-window, which selects the new window by default. The parent session is therefore switched away to the child's window on every spawn, disrupting the parent's context.Expected behavior
Spawning a subagent should stay fire-and-forget: the new window should be created in the background and the parent should remain in its own window. The parent already receives the report asynchronously via the result socket, so there is no reason to focus the child.
Fix
Pass
-d(--no-select) totmux new-windowinspawn()inindex.ts, so the new window does not become the current window.