KillShell
Kill a background shell started via Bash with run_in_background: true. Sends SIGKILL to the shell’s entire process group, then removes the shell from the registry.
Schema
Section titled “Schema”| Param | Type | Required |
|---|---|---|
shell_id | string | yes |
Behaviour
Section titled “Behaviour”- Looks up the shell in the registry. Unknown id → error result.
syscall.Kill(-pgid, SIGKILL)— negative pid targets the whole process group, catching any children the shell forked.- Removes the shell from the registry. Subsequent
BashOutputcalls for the same id returnunknown shell_id.
Success output
Section titled “Success output”killed: 2b1d94c0-...-e6Process-group semantics
Section titled “Process-group semantics”Bash in background mode starts every shell with Setpgid: true, so bash and all its descendants share a process group. A single SIGKILL to the negative-pid pgid terminates the whole subtree. Without this, npm run build (which spawns node + webpack workers) would leave zombies after the shell died.
Related
Section titled “Related”- Bash — launching.
- BashOutput — polling.