Skip to content

refactor: converge the process-group kill primitive into util/process #515

Description

@LeXwDeX

Why

The platform group-kill primitive (win32 taskkill /T /F vs unix negative-pid process.kill) is duplicated between hook/settings.ts execShell (its killGroup) and util/process.ts (stop win32 branch, signalTree), with diverging error handling. Code review of #500-504 flagged the shape as drifting (four near-copies of the escalation chain; the SDK copy has already diverged semantically).

Scope

Approach

  • Extract a shared killGroupPid(pid, signal?) primitive in util/process.ts: unix process.kill(-pid, signal), win32 taskkill /pid <pid> /T /F, best-effort with a boolean result; reuse it in stop's win32 branch and replace the hook's killGroup body with it (hook keeps its own logging and killSent state).
  • No behavior change to the fix: hook command grandchildren hold stdio pipes and hang triggers forever #500 timeout semantics: same signals, same ordering, same grace constants.

Acceptance

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions