Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

560 B
Raw Blame
import type { HostSession } from './session'

/** Request a real process kill before entering the one retirement path. A thrown kill is unknown,
 * not evidence that the process is already dead: propagating keeps the generation registered and
 * prevents a false successful deletion of a still-running unmanaged PTY. */
export async function killHostSession(
  session: HostSession,
  beginRetirement: (session: HostSession) => Promise<void>
): Promise<void> {
  if (!session.exited && !session.retiring) session.proc.kill()
  await beginRetirement(session)
}