feat(acp): supervisor spawn / handshake / monitor / kill / onExit

This commit is contained in:
2026-05-07 14:01:04 +08:00
parent b4694e113b
commit 70c86a552b
3 changed files with 324 additions and 2 deletions
+14
View File
@@ -0,0 +1,14 @@
//go:build windows
package acp
import "time"
// unixGracefulTerm 在 Windows 上没有可靠的 SIGTERM 等价信号(CTRL_BREAK 仅
// 对 console 子进程生效)。直接 Process.Kill,grace 参数不参与,仅签名一致。
func (s *Supervisor) unixGracefulTerm(proc *Process, grace time.Duration) {
if proc.Cmd.Process == nil {
return
}
_ = proc.Cmd.Process.Kill()
}