Function termion::is_tty

source ·
pub fn is_tty<T: AsRawFd>(stream: &T) -> bool
Expand description

Is this stream a TTY?

Examples found in repository?
examples/is_tty.rs (line 6)
5
6
7
8
9
10
11
fn main() {
    if termion::is_tty(&fs::File::create("/dev/stdout").unwrap()) {
        println!("This is a TTY!");
    } else {
        println!("This is not a TTY :(");
    }
}