1 2 3 4 5 6 7
fn main() { if atty::is(atty::Stream::Stdout) { println!("stdout is a tty") } else { println!("stdout is not a tty") } }