Skip to content

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.

ParamTypeRequired
shell_idstringyes
  1. Looks up the shell in the registry. Unknown id → error result.
  2. syscall.Kill(-pgid, SIGKILL) — negative pid targets the whole process group, catching any children the shell forked.
  3. Removes the shell from the registry. Subsequent BashOutput calls for the same id return unknown shell_id.
killed: 2b1d94c0-...-e6

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.