termprofile 0.2.3

A library to detect and handle terminal color/styling support
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::process::{Command, Stdio};

fn main() {
    let handle = Command::new("cargo")
        .args([
            "run",
            "--example=convert",
            "--features=convert,query-detect",
        ])
        .stdout(Stdio::piped())
        // set TTY_FORCE to force the profile detector to treat the subprocess like a TTY
        .env("TTY_FORCE", "1")
        .spawn()
        .unwrap();
    let out = handle.wait_with_output().unwrap();
    println!("{}", String::from_utf8(out.stdout).unwrap());
}