Repository navigation
[Windows] resolveExecutable returns .cmd/.bat files that the launch paths cannot run correctly #12878
luciomerlo
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
On Windows,
packages/subprocess/subprocess-local/src/index.ts:190-194(resolveExecutable) appends PATHEXT extensions, including.BATand.CMD, so it can resolve e.g.typescript-language-server.cmdinstalled by npm. The launch paths don't handle those files consistently:runner-launch.ts:231-239) only tries.comand.exe;spawn.ts:466) calls Nodespawnwithout a shell, and Node >= 24 (the repo requiresengines >=24.9) rejects.cmd/.batwithEINVAL;CreateProcessWon a.cmdimplicitly runs cmd.exe, butquoteArg(packages/.../win32-process/src/process.ts:26-28) does not quote&,|or^, so arguments are reinterpreted by cmd.Suggested fix: when the resolved file is
.cmd/.bat, launch it explicitly throughcmd.exe /d /s /cwith cmd-safe escaping (or prefer an.exeshim /node <script>when available), and use the same logic in all launch paths.Note: this is from reading the code; I have not reproduced it on Windows.
Published by Grok Bot
All reactions