pub struct DetectOptions {
pub allow_commands: bool,
pub capture_env_subset: bool,
}Expand description
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 controls the diagnostic map; matched
identifiers and raw terminal names remain in the result regardless of this setting.
See 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.
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
);
}Fields§
§allow_commands: boolRun tmux, screen, or zellij probes using the supplied environment. Defaults to false.
capture_env_subset: boolRetain accessed environment values in the diagnostic map. Defaults to true.