Skip to main content

detect_with_env

Function detect_with_env 

Source
pub fn detect_with_env(
    colorterm: Option<&str>,
    term: Option<&str>,
) -> ColorCapability
Expand description

Detect color capability with explicit environment values (for testing).

This function allows testing the detection logic with specific environment variable values without modifying the actual environment.

§Arguments

  • colorterm - Optional value for $COLORTERM
  • term - Optional value for $TERM

§Returns

The ColorCapability that would be detected with the given environment.

§Note

This function does NOT cache its result and is primarily intended for testing purposes. For normal usage, use detect_color_capability().