Skip to main content

should_activate

Function should_activate 

Source
pub fn should_activate(
    tui_enabled: bool,
    stdin_tty: bool,
    stdout_tty: bool,
    stderr_tty: bool,
) -> bool
Expand description

Whether the TUI should activate for this process: config.tui_enabled AND stdin/stdout/stderr are all a real terminal. crates/cli’s chat() is the sole call site that matters for the “default-off / non-tty / --print = byte-identical REPL” contract (P5-4’s build brief) — a piped/non-interactive invocation (virtually every CI/test run, regardless of whether a parity preset sets capabilities.tui.enabled = true) always falls through to the pre-P5-4 REPL because THIS check fails, not because the config bit is off.

Takes the three tty booleans as explicit parameters (rather than calling std::io::IsTerminal itself) so this stays testable without a real terminal — crates/cli passes io::stdin().is_terminal()/io::stdout().is_terminal()/ io::stderr().is_terminal() at the real call site.