The best way to control Claude Code, Codex and more from any computer or phone

main
ts 9 lines 380 Bytes
Raw
1 /** `kill(0)` signals this server's group; `kill(-1)` signals every process the user owns. */
2 export function signalProcessGroup(pid: number, signal: NodeJS.Signals | 0): void {
3 if (!Number.isSafeInteger(pid) || pid <= 1) {
4 throw Object.assign(new Error(`kill ESRCH: not a spawned process group (${pid})`), {
5 code: "ESRCH",
6 });
7 }
8 process.kill(-pid, signal);
9 }