Skip to main content

capture_group_command

Function capture_group_command 

Source
pub fn capture_group_command(
    command: &mut Command,
    limits: OutputLimits,
) -> Result<ExecutionEvidence, ToolError>
Expand description

Capture one caller-configured command in a newly owned process group.

Uses the same bounded, fair stdout/stderr capture and deadline as capture_command, with null stdin and no executable admission or retries. Preserves caller command settings except IO and process-group selection; the latter is replaced with a new owned group. On natural leader exit, timeout, overflow or IO failure, remaining group members are signalled before reaping the leader. Original failures and group/direct-child cleanup errors remain separate in ExecutionError. There is no implicit background handoff.

Callers must not reap the leader independently or change its group. Escaped descendants are not contained, and signalling is not proof of descendant exit or completed external effects. Synchronous spawning/setup/cleanup can exceed the deadline. Admission, budgets, inherited descriptors and recovery remain caller-owned. Use capture_command for the existing direct-child contract.

ยงErrors

Rejects invalid deadlines before modifying/spawning the command. Execution failures retain bounded output, observed status and separate cleanup errors.