Skip to content

fix: run setup steps as separate tasks so Windows PowerShell works - #15

Merged
lowlorenz merged 2 commits into
devfrom
fix/windows-install-shell-separator
Jul 29, 2026
Merged

fix: run setup steps as separate tasks so Windows PowerShell works#15
lowlorenz merged 2 commits into
devfrom
fix/windows-install-shell-separator

Conversation

@lowlorenz

Copy link
Copy Markdown
Contributor

The bootstrap install ran npm install -g <pkg> && pi install <src> as a single ShellExecution. Windows PowerShell 5.1 — still the default shell on many Windows machines — rejects && as a statement separator, so the auto-install failed before installing anything. The pi-package migration path had the same problem (pi remove X && pi install Y).

No separator works across cmd, PowerShell and POSIX shells, so each command now runs as its own task, short-circuiting on the first non-zero exit to preserve && semantics. Tasks share a name to reuse one terminal panel; only the first clears, so a multi-step run reads as one log.

Why not the alternatives

  • Swapping && for ; — works in PowerShell, not in cmd.
  • Forcing cmd.exe via ShellExecutionOptions — pins a shell and loses the user's login-shell PATH setup.

Verification

  • npx tsc --noEmit -p tsconfig.json — clean
  • npm run build — clean
  • node test/run-ui-test.mjs — 18/18 PASS

Not verified

The bootstrap path is skipped under the test harness (CHRONOS_SKIP_BOOTSTRAP=1) and I have no Windows machine, so the PowerShell 5.1 failure itself is untested end-to-end. Someone on Windows should confirm the auto-install completes before this is cut into a release.

The bootstrap install ran `npm install -g <pkg> && pi install <src>` as a
single ShellExecution. Windows PowerShell 5.1 — still the default shell on
many Windows machines — rejects `&&` as a statement separator, so the
auto-install failed before installing anything. The pi-package migration
path had the same problem (`pi remove X && pi install Y`).

No separator works across cmd, PowerShell and POSIX shells, so run each
command as its own task instead, short-circuiting on the first non-zero
exit to preserve && semantics. Tasks share a name to reuse one terminal
panel; only the first clears so a multi-step run reads as one log.

Untested on Windows itself: the bootstrap path is skipped under the UI
test harness (CHRONOS_SKIP_BOOTSTRAP=1).
Ships the Windows PowerShell fix for the bootstrap installer: running
`npm install -g <pkg> && pi install <src>` as a single ShellExecution
failed on Windows PowerShell 5.1, which rejects && as a statement
separator, so the auto-install never ran.
@lowlorenz
lowlorenz merged commit 912d25c into dev Jul 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant