fix(shared): Windows .cmd shims no longer print DEP0190 on every spawn (#19385)

Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Theo BrowneandClaude Opus 5.5 authored and GitHub committed 2026-10-14 04:17:42 -07:00
1 parent f5b5f9dd7b
commit c08093c2b1
8 files changed
+89 -75

No files matched your search

@@ -153,11 +153,15 @@ it.effect("launches an installed editor with platform-safe arguments", () =>
);
assert.ok(spawned);
assert.equal(spawned.command, '^"C:\\Program^ Files\\Microsoft^ VS^ Code\\bin\\code.CMD^"');
assert.deepEqual(spawned.args, [
'^"--goto^"',
'^"C:\\workspace^ with^ spaces\\src\\index.ts:12:4^"',
]);
assert.equal(
spawned.command,
[
'^"C:\\Program^ Files\\Microsoft^ VS^ Code\\bin\\code.CMD^"',
'^"--goto^"',
'^"C:\\workspace^ with^ spaces\\src\\index.ts:12:4^"',
].join(" "),
);
assert.deepEqual(spawned.args, []);
assert.equal(spawned.options.shell, true);
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
);
@@ -241,12 +245,16 @@ it.effect("launches Cursor in classic IDE mode through the Windows command shim"
);
assert.ok(spawned);
assert.equal(spawned.command, '^"C:\\Program^ Files\\Cursor\\bin\\cursor.CMD^"');
assert.deepEqual(spawned.args, [
'^"--classic^"',
'^"--goto^"',
'^"C:\\workspace^ with^ spaces\\src\\index.ts:12:4^"',
]);
assert.equal(
spawned.command,
[
'^"C:\\Program^ Files\\Cursor\\bin\\cursor.CMD^"',
'^"--classic^"',
'^"--goto^"',
'^"C:\\workspace^ with^ spaces\\src\\index.ts:12:4^"',
].join(" "),
);
assert.deepEqual(spawned.args, []);
assert.equal(spawned.options.shell, true);
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
);
@@ -1033,12 +1041,13 @@ for (const { platform, installPath, editor, args } of [
),
);
assert.ok(spawned);
const shim = executable.endsWith(".cmd");
assert.equal(
spawned.command,
executable.endsWith(".cmd") ? `^"${executable.replaceAll(" ", "^ ")}^"` : executable,
shim ? [`^"${executable.replaceAll(" ", "^ ")}^"`, ...args].join(" ") : executable,
);
assert.deepEqual(spawned.args, args);
assert.equal(spawned.options.shell, executable.endsWith(".cmd"));
assert.deepEqual(spawned.args, shim ? [] : args);
assert.equal(spawned.options.shell, shim);
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
);
}
@@ -1476,10 +1485,12 @@ it.effect("starts a Windows command shim for unicode paths with cmd metacharacte
assert.isTrue(Exit.isSuccess(exit));
assert.ok(spawned);
assert.equal(spawned.options.shell, true);
assert.deepEqual(spawned.args, [
'^"--goto^"',
'^"C:\\Users\\jö\\R^&D^ ^(100^%^)\\naïve^ ^^file^!.ts:3:7^"',
]);
assert.deepEqual(spawned.args, []);
assert.isTrue(
spawned.command.endsWith(
' ^"--goto^" ^"C:\\Users\\jö\\R^&D^ ^(100^%^)\\naïve^ ^^file^!.ts:3:7^"',
),
);
}),
);