fix(watcher): always tree-kill on stop regardless of childProcess.killed flag
Some checks failed
Default (tags) / security (push) Successful in 33s
Default (tags) / test (push) Failing after 39s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped

The direct bash child may already be dead from terminal SIGINT while
grandchildren (tsrun, devserver) are still running. Removing the .killed
guard ensures tree-kill always runs to clean up the entire process tree.
This commit is contained in:
2026-03-04 00:09:21 +00:00
parent 77d2e6ee57
commit f7f42ff36c
3 changed files with 1698 additions and 2716 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@git.zone/tswatch",
"version": "3.2.2",
"version": "3.2.3",
"private": false,
"description": "A development tool for automatically watching and re-compiling TypeScript projects upon detecting file changes, enhancing developer workflows.",
"exports": {

4408
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -202,7 +202,9 @@ export class Watcher {
clearTimeout(this.debounceTimer);
}
await this.smartwatchInstance.stop();
if (this.currentExecution && !this.currentExecution.childProcess.killed) {
if (this.currentExecution) {
// Always tree-kill — even if the direct child is dead (.killed === true),
// grandchildren (e.g. tsrun, devserver) may still be running.
await this.currentExecution.kill();
}
}