Commit c5e09e7
authored
fix: route Windows
## Summary
Running a `node_modules/.bin/*.cmd` shim on Windows — what `vp run
<script>` does when resolving `vite`, `tsc`, etc. — triggers `cmd.exe`'s
*"Terminate batch job (Y/N)?"* prompt on Ctrl+C. That prompt leaves the
terminal in a corrupt state: backspace prints `^H`, Ctrl+C prints `^C`,
input becomes sluggish.
Pulls in voidzero-dev/vite-task#345 (merged as `c45e5e72`), which
teaches the plan layer to rewrite the invocation at plan time:
```
program_path: <abs path to pwsh.exe or powershell.exe>
args: [-NoProfile, -NoLogo, -ExecutionPolicy, Bypass, -File,
<.ps1 path relative to task cwd>, ...original_args]
```
PowerShell resolves `-File <relative>` against its own working directory
(= the task's cwd) and lands on the correct `.ps1`, so Ctrl+C propagates
cleanly without the `cmd.exe` hop. The `.ps1` path is **cwd-relative**
so `SpawnFingerprint.args` stays portable — no absolute paths leak into
cache keys.
The rewrite only fires when **all** of these hold: extension is `.cmd`,
path lives inside the workspace root, the two last path components are
`.bin` / `node_modules` (case-insensitive), a sibling `.ps1` exists, and
`pwsh.exe` / `powershell.exe` is on PATH. Any miss keeps the original
`.cmd` path — behavior matches pre-merge.
Also includes a previously-pushed CI fix: the musl test job disables
`crt-static` so `fspy_preload_unix`'s cdylib build doesn't fail after
voidzero-dev/vite-task#344 made that crate an unconditional build-dep.
Closes #1176
## Test plan
- [x] `cargo check --workspace` clean on macOS
- [x] vite-task CI green on the merged PR (includes new Windows-only
plan snapshot verifying the rewrite end-to-end across `cwd` and
`--filter` invocations)
- [ ] vite-plus CI green
- [ ] Manual on Windows: reproduce with
https://github.com/Curtion/report-vite-plus-1; Ctrl+C during `vp run
dev` should leave the terminal clean
- [ ] Manual: confirm `.cmd` fallback on a Windows box with PATH
stripped of PowerShell
- [ ] Manual: confirm a globally installed `.cmd` outside the workspace
is *not* rewritten.cmd shims through PowerShell to fix Ctrl+C terminal corruption (#1414)1 parent 562365d commit c5e09e7
File tree
6 files changed
+73
-49
lines changed- .github/workflows
- packages/cli/snap-tests/npm-install-with-options
6 files changed
+73
-49
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
124 | 131 | | |
125 | 132 | | |
126 | 133 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| |||
Lines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
34 | | - | |
| 32 | + | |
35 | 33 | | |
36 | 34 | | |
37 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
0 commit comments