Skip to main content

shell_command

Function shell_command 

Source
fn shell_command(command_line: &str) -> Command
Expand description

Build the command for executing command_line through a shell.

The shell is decidedly non-interactive. The child is placed in a new session (setsid), so it has no controlling terminal: programs that prompt on a tty (git, ssh, …) open /dev/tty directly, bypassing stdin, and a blocked read on it would stop the whole command with SIGTTIN. With no terminal to prompt on, they fail fast instead. The remaining knobs cover prompt paths that don’t use a tty at all.

kill_on_drop is enabled so that dropping the future awaiting the command’s output kills the child, letting an interrupted tool call abort a still-running command.