GeezerVison is showing github.com — fix(cli): stop global vp dev on SIGTERM by fengmk2 · Pull Request #3521 · voidzero-dev/vite-plus
Conversation
fengmk2
commented
Nov 21, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
On Unix, global vp dev runs three processes: the Rust vp, node dist/bin.js from the project's vite-plus, and Vite. A SIGTERM or SIGHUP to the vp process ID stopped only vp. dist/bin.js and Vite kept running, and Vite kept the port open. #3512 does not change this path, because dist/bin.js keeps Vite as a child process when the global CLI starts it.
execute_with_terminal_guard now forwards SIGTERM and SIGHUP to its child while the child runs. The global CLI and dist/bin.js both use this function, so a signal to the vp process ID passes through dist/bin.js to Vite. vp then exits with Vite's exit code (143 for SIGTERM).
SIGINT is still not forwarded. The terminal sends Ctrl+C to the whole process group, so a forwarded copy would reach the child a second time.
- A signal that the caller ignores, such as
SIGHUP under nohup, stays ignored.
The global CLI uses this function for every command that it delegates to dist/bin.js. Inside dist/bin.js, only vp dev and vp preview use it. Other commands, such as vp build, still stop only dist/bin.js and leave their child running. Project-local vp preview, and project-local vp dev when it keeps Vite as a child process (in a Worker or with an IPC channel), now also stop on these signals.
Stacked on #3512. Refs #3106.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Global `vp dev` runs the Rust `vp`, `node dist/bin.js`, and Vite. A
SIGTERM to the `vp` process ID stopped only `vp`, and Vite kept the
port open.
`execute_with_terminal_guard` now forwards SIGTERM and SIGHUP to the
child while the child runs. Both wrappers use this function, so the
signal passes through `dist/bin.js` to Vite. SIGINT is still not
forwarded, because the terminal sends Ctrl+C to the whole process
group. A signal that the caller ignores stays ignored.
Refs #3106.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
🚀 Deploying Preview to Cloudflare 🚀
This URL reflects your latest Preview deployment
Preview Deployments by commit
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
fengmk2
changed the title
fix(cli): forward SIGTERM and SIGHUP from vp wrappers to the child
fix(cli): stop global vp dev on SIGTERM
Nov 21, 2026
CLI artifact sizes (8622c23)
Final release artifacts built by the canonical build-upstream and build-windows-cli actions.
The dist rows use the Linux build. The core total excludes .node files to match the release artifact.
| Artifact |
Format |
Base |
PR |
Change |
packages/cli/dist |
Directory total |
2.38 MiB |
2.38 MiB |
0 B (0.00%) |
packages/core/dist |
Directory total |
4.11 MiB |
4.11 MiB |
0 B (0.00%) |
| Combined package dist |
Directory total |
6.49 MiB |
6.49 MiB |
0 B (0.00%) |
vp (Linux x64) |
Binary |
8.51 MiB |
8.51 MiB |
0 B (0.00%) |
vp (Linux x64) |
gzip -9 |
3.89 MiB |
3.89 MiB |
+1.59 KiB (+0.04%) |
| NAPI (Linux x64) |
Binary |
37.23 MiB |
37.23 MiB |
0 B (0.00%) |
| NAPI (Linux x64) |
gzip -9 |
14.87 MiB |
14.87 MiB |
+306 B (+0.00%) |
vp (macOS ARM64) |
Binary |
5.57 MiB |
5.57 MiB |
+16 B (+0.00%) |
vp (macOS ARM64) |
gzip -9 |
3.32 MiB |
3.32 MiB |
+229 B (+0.01%) |
| NAPI (macOS ARM64) |
Binary |
43.77 MiB |
43.77 MiB |
-16 B (-0.00%) |
| NAPI (macOS ARM64) |
gzip -9 |
19.01 MiB |
19.01 MiB |
+362 B (+0.00%) |
vp (Windows x64) |
Binary |
6.59 MiB |
6.59 MiB |
0 B (0.00%) |
vp (Windows x64) |
gzip -9 |
3.01 MiB |
3.01 MiB |
+2 B (+0.00%) |
| NAPI (Windows x64) |
Binary |
33.18 MiB |
33.18 MiB |
0 B (0.00%) |
| NAPI (Windows x64) |
gzip -9 |
13.60 MiB |
13.60 MiB |
-1 B (-0.00%) |
| Trampoline (Windows x64) |
Binary |
13.50 KiB |
13.50 KiB |
0 B (0.00%) |
| Trampoline (Windows x64) |
gzip -9 |
7.09 KiB |
7.09 KiB |
0 B (0.00%) |
| Installer (Windows x64) |
Binary |
4.69 MiB |
4.69 MiB |
0 B (0.00%) |
| Installer (Windows x64) |
gzip -9 |
2.25 MiB |
2.25 MiB |
0 B (0.00%) |
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Closing. Three review findings come from signal forwarding itself:
- In a Worker, the native
SIGTERM handler replaces the host app's handler.
- When a supervisor signals the whole process tree, Vite receives
SIGTERM twice and stops before its async cleanup finishes.
vp exits with code 143 instead of terminating by SIGTERM.
A forwarding wrapper cannot tell a signal sent only to its process ID from a signal sent to the whole tree, so this design cannot fix the second finding. Global vp dev stays as it is on main. A later fix could remove the wrapper processes with exec instead (row 8 of #3106).
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|