1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! The child of `starmap run`. This module builds the program's command,
//! and crumbkit-child starts it (PROC-1).
//!
//! Each run states the five items of PROC-2.
//!
//! - Program: the first word after `--`, found on the `PATH` of the
//! process that runs starmap. The person who runs starmap names it.
//! - Arguments: the remaining words after `--`, each a separate value. No
//! shell parses them, and no value of a variable is ever an argument.
//! - Environment: the child inherits the environment of the process that
//! runs starmap, and `Environment::apply` then sets each declared
//! variable that has a value and removes each that stays unset.
//! crumbkit-child adds the variables that join the run's trace.
//! - Streams and deadline: the child reads and writes the terminal
//! directly, and has no deadline, because it is the program the person
//! asked to run.
//! - End: crumbkit-child waits for the child and reaps it. starmap ignores
//! SIGINT and SIGQUIT from the moment the child starts, so Ctrl-C and
//! Ctrl-\ reach only the child, and starmap returns the child's exit
//! code, or 128 plus the number of the signal that ended it.
use OsString;
use Command;
/// Returns the command that runs `words`: the program and its arguments.
pub