Bug: Missing SIGHUP handler leaves daemon uncleanly terminated
Location: packages/hub/src/daemon.ts lines 203-211
Problem: The daemon registers handlers for SIGTERM and SIGINT but not SIGHUP. When a user closes the terminal window on Windows, SIGHUP is sent but cleanup() is never called, leaving:
- Orphaned Windows Firewall rules
- Leftover
hub.pid and hub.json files
- Stuck sleep prevention flag
- Orphaned node processes
Suggested fix: Add SIGHUP handler alongside existing SIGTERM/SIGINT:
process.on("SIGHUP", () => {
cleanup();
process.exit(0);
});
Environment: Windows 11 + WSL2 (Hyper-V), Node.js 20.x
Bug: Missing SIGHUP handler leaves daemon uncleanly terminated
Location:
packages/hub/src/daemon.tslines 203-211Problem: The daemon registers handlers for
SIGTERMandSIGINTbut notSIGHUP. When a user closes the terminal window on Windows, SIGHUP is sent butcleanup()is never called, leaving:hub.pidandhub.jsonfilesSuggested fix: Add SIGHUP handler alongside existing SIGTERM/SIGINT:
Environment: Windows 11 + WSL2 (Hyper-V), Node.js 20.x