-
Notifications
You must be signed in to change notification settings - Fork 227
Description
Bug Report
Description
Lifecycle scripts (setup/run/teardown) in TaskLifecycleService.ts use child_process.spawn with shell: true and piped stdout/stderr — no TTY. This means any tool that checks for an interactive terminal fails when run via lifecycle scripts, even though the exact same command works perfectly in the terminal tab right next to it.
Root Cause
The terminal tab uses node-pty which provides full TTY support. Lifecycle scripts use child_process.spawn which provides no TTY — programs see process.stdout.isTTY === false and either degrade or fail.
Affected Tools
Any dev tool that detects TTY and changes behavior:
| Tool | In terminal tab (PTY) | In lifecycle script (spawn) |
|---|---|---|
| Turborepo | TUI dashboard works | Falls back to plain logs or crashes |
| Expo | Interactive device menu | Fails or skips interactivity |
| Vite / Next.js | Colored output, key shortcuts | Plain text, no interactivity |
| Docker Compose | Colored, formatted output | Raw unformatted logs |
Steps to Reproduce
- Set a project's run script to something interactive (e.g.,
turbo dev) - Start a task — lifecycle script runs the command
- The tool fails or degrades because it detects no TTY
- Run the same command manually in the terminal tab — works perfectly
Expected Behavior
Lifecycle scripts should run with full TTY support, matching the terminal tab behavior.
Suggested Fix
Run lifecycle scripts via node-pty (same as the terminal tab does) instead of child_process.spawn. At minimum, offer this as a configuration option so users can opt into PTY-backed lifecycle scripts when their tools require interactivity.
Affected Code
src/main/services/LifecycleScriptsService.ts— Currently useschild_process.spawn- Should leverage the same
node-ptyinfrastructure used bysrc/main/services/ptyManager.ts