Skip to content

fix: use exec/spawn with shell for Windows .cmd compatibility#20

Open
0Prime wants to merge 1 commit into
pithings:mainfrom
0Prime:main
Open

fix: use exec/spawn with shell for Windows .cmd compatibility#20
0Prime wants to merge 1 commit into
pithings:mainfrom
0Prime:main

Conversation

@0Prime

@0Prime 0Prime commented Jun 12, 2026

Copy link
Copy Markdown

Problem

Clicking the Pi icon in the activity bar to open the Packages sidebar shows:

An error occurred while loading view: pi-vscode.packages

On Windows, findPiBinary() resolves to a .cmd file (e.g. node_modules/.bin/pi.cmd). execFile and spawn without { shell: true } cannot execute .cmd batch scripts directly, producing spawn EINVAL.

Fix

  • execFileexec with forward-slash path conversion (bin.split('\\').join('/'))
  • spawnspawn with { shell: true }

This is a known Windows + Node.js ≥ 20.14 issue (Electron 30 breaking change for .bat/.cmd execution).

Fixes #19

Verification

  • pnpm fmt passes
  • pnpm typecheck passes
  • Tested on Windows 10 Pro (Build 19045) with Node.js v24.14.1 — Packages view loads and lists installed packages

execFile and spawn without shell: true fail with EINVAL on Windows
when the pi binary resolves to a .cmd file (e.g. node_modules/.bin/pi.cmd).

- execFile → exec with forward-slash path conversion
- spawn → spawn with { shell: true }

Fixes #<TBD>
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.

[BUG] Packages view fails on Windows with spawn EINVAL

1 participant