Bug Description
Lifecycle scripts (setup, run, teardown, stop) configured in .emdash.json fail silently on Windows. The scripts never execute, no error is shown to the user, and the setup tracking window remains empty.
Root Cause
In ptyManager.ts, startLifecyclePty() spawns lifecycle scripts with Unix shell flags:
const proc = pty.spawn(defaultShell, ['-ilc', command], { ... })
On Windows, defaultShell resolves to cmd.exe (via ComSpec), which does not understand the -ilc flags (these are bash/sh flags for interactive, login, command). The command is silently ignored by cmd.exe.
In contrast, the regular agent terminal (startPty()) correctly handles Windows via resolveWindowsPtySpawn(), which wraps commands with cmd.exe /d /s /c flags. This function is not used for lifecycle scripts.
Steps to Reproduce
- On Windows, create a project with
.emdash.json:
-
- {
- "scripts": {
-
- }
- }
-
- Create a new task
- Observe that "echo hello" never executes — no output in the setup tracking window
Expected Behavior
The setup script should execute and show "hello" in the setup tracking output.
Suggested Fix
Apply the same Windows shell handling (resolveWindowsPtySpawn() or equivalent) to startLifecyclePty() so that lifecycle scripts work correctly with cmd.exe on Windows.
Workaround
Use shellSetup instead of scripts.setup, since shellSetup runs in the agent terminal which has proper Windows support:
{
"shellSetup": "C:\\PROGRA~1\\Git\\bin\\bash.exe -l .emdash/setup.sh"
}
Environment
- OS: Windows 11 (build 26200.8037)
- Default shell: cmd.exe (ComSpec)
Bug Description
Lifecycle scripts (setup, run, teardown, stop) configured in
.emdash.jsonfail silently on Windows. The scripts never execute, no error is shown to the user, and the setup tracking window remains empty.Root Cause
In
ptyManager.ts,startLifecyclePty()spawns lifecycle scripts with Unix shell flags:On Windows,
defaultShellresolves tocmd.exe(viaComSpec), which does not understand the-ilcflags (these are bash/sh flags for interactive, login, command). The command is silently ignored bycmd.exe.In contrast, the regular agent terminal (
startPty()) correctly handles Windows viaresolveWindowsPtySpawn(), which wraps commands withcmd.exe /d /s /cflags. This function is not used for lifecycle scripts.Steps to Reproduce
.emdash.json:Expected Behavior
The setup script should execute and show "hello" in the setup tracking output.
Suggested Fix
Apply the same Windows shell handling (
resolveWindowsPtySpawn()or equivalent) tostartLifecyclePty()so that lifecycle scripts work correctly withcmd.exeon Windows.Workaround
Use
shellSetupinstead ofscripts.setup, sinceshellSetupruns in the agent terminal which has proper Windows support:{ "shellSetup": "C:\\PROGRA~1\\Git\\bin\\bash.exe -l .emdash/setup.sh" }Environment