Skip to content

fix(dev): kill process tree on Windows - #15

Merged
tatang26 merged 1 commit into
mainfrom
dev-tool-fix-for-windows
May 8, 2026
Merged

fix(dev): kill process tree on Windows#15
tatang26 merged 1 commit into
mainfrom
dev-tool-fix-for-windows

Conversation

@tatang26

@tatang26 tatang26 commented May 8, 2026

Copy link
Copy Markdown
Contributor

This PR fixes the go tool dev command on Windows, which returned TerminateProcess: Access is denied when Ctrl+C was pressed.

go run executes the compiled binary as a child process, so when that process's PID is terminated, only the go run process is terminated, leaving the actual application running and the port blocked. Unix already addressed this with process groups (Setpgid); Windows doesn't have an equivalent.

Fix:

  • Set CREATE_NEW_PROCESS_GROUP on the child process.
  • Use taskkill /T /F /PID to terminate the entire process tree.

@tatang26
tatang26 merged commit 8a331ae into main May 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant