Summary
On Windows, spawn.sh renames the boot script with a .command extension (spawn.sh:307), which causes Windows to treat the file as a plain text document and open it with the default text application (e.g. Notepad) instead of executing it as a bash script. The spawned agent never starts.
This occurs only inside tmux (psmux on Windows). Outside tmux, the launch_windows_terminal path uses wt.exe new-tab bash -l "$BOOT", which explicitly invokes bash and is unaffected by the file extension.
Root cause
# spawn.sh:307
mv "$BOOT" "$BOOT.command" # .command so macOS `open` runs it in Terminal
The .command extension is a macOS convention — Terminal.app recognises it and executes the file as a shell script. On Windows, .command has no shell association. When tmux's split-window attempts to run the file, Windows processes it as a plain text file open rather than script execution.
Reproduction
# Inside tmux (psmux) on Windows
spawn.sh codex reviewer --project "$(pwd)" --team <team>
# → A new tmux pane opens, but the boot script is opened in Notepad
# instead of being executed. No codex session is created.
Verified by checking ~/.codex/sessions/ — no rollout files are created after the tmux spawn, whereas spawning outside tmux (same machine, same boot script content) creates rollout files immediately.
Suggested fix
Skip the .command rename on non-macOS platforms. The extension is only needed for the macOS open -a Terminal path (launch_macos_terminal); all other launch paths invoke bash explicitly and don't depend on the extension.
# Only rename to .command on macOS where `open -a` needs it
case "$(uname -s)" in
Darwin) mv "$BOOT" "$BOOT.command"; BOOT="$BOOT.command" ;;
esac
Environment
- Windows 11, Git Bash (MSYS2), psmux (tmux for Windows)
- agmsg installed at
~/.agents/skills/agmsg/
- codex-cli 0.142.5
Related
Summary
On Windows,
spawn.shrenames the boot script with a.commandextension (spawn.sh:307), which causes Windows to treat the file as a plain text document and open it with the default text application (e.g. Notepad) instead of executing it as a bash script. The spawned agent never starts.This occurs only inside tmux (psmux on Windows). Outside tmux, the
launch_windows_terminalpath useswt.exe new-tab bash -l "$BOOT", which explicitly invokes bash and is unaffected by the file extension.Root cause
The
.commandextension is a macOS convention — Terminal.app recognises it and executes the file as a shell script. On Windows,.commandhas no shell association. When tmux'ssplit-windowattempts to run the file, Windows processes it as a plain text file open rather than script execution.Reproduction
Verified by checking
~/.codex/sessions/— no rollout files are created after the tmux spawn, whereas spawning outside tmux (same machine, same boot script content) creates rollout files immediately.Suggested fix
Skip the
.commandrename on non-macOS platforms. The extension is only needed for the macOSopen -a Terminalpath (launch_macos_terminal); all other launch paths invoke bash explicitly and don't depend on the extension.Environment
~/.agents/skills/agmsg/Related