purple-ssh 2.40.0

Open-source terminal SSH manager and SSH config editor. Search hundreds of hosts, sync from 16 clouds, transfer files, manage Docker and Podman over SSH, sign short-lived Vault SSH certs and expose an MCP server for AI agents. Rust TUI, MIT licensed.
Documentation
use std::sync::atomic::{AtomicBool, Ordering};

/// Global flag checked by all disk-write functions.
static DEMO_MODE: AtomicBool = AtomicBool::new(false);

/// Returns true if demo mode is active (no disk writes).
pub fn is_demo() -> bool {
    DEMO_MODE.load(Ordering::Relaxed)
}

/// Enable demo mode. Called once at startup by `demo::build_demo_app()`.
pub fn enable() {
    DEMO_MODE.store(true, Ordering::Relaxed);
}

/// Disable demo mode. Used by tests to reset global state.
#[cfg(test)]
pub fn disable() {
    DEMO_MODE.store(false, Ordering::Relaxed);
}