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
39
40
41
42
43
44
45
46
47
48
/// Controls optional command probes and diagnostic environment capture.
///
/// Defaults perform environment-only detection and capture the variables consulted by the
/// detector. Command probes are opt-in, synchronous, and have no timeout.
/// [`capture_env_subset`](Self::capture_env_subset) controls the diagnostic map; matched
/// identifiers and raw terminal names remain in the result regardless of this setting.
///
/// See [Optional command probes](crate#optional-command-probes) for commands, prerequisites, and
/// failure behavior. Disabling capture is not a privacy filter for the rest of the result.
///
/// # Example
///
/// With a matching session marker and executable on `PATH`, inspect the attempted probes.
/// This example can block while the external commands run.
///
/// ```no_run
/// use detect_terminal::{DetectOptions, detect_with_options};
///
/// let env = std::env::vars_os().collect();
/// let options = DetectOptions {
/// allow_commands: true,
/// ..DetectOptions::default()
/// };
/// let info = detect_with_options(&env, options);
/// for probe in &info.command_probes {
/// println!(
/// "Command: {}; exit: {:?}; error: {:?}",
/// probe.command, probe.status, probe.error
/// );
/// }
/// ```