novel-api 0.19.1

Novel APIs from various sources
Documentation
mod dir;
mod input;
mod keyring;
mod self_update;
mod webp;
mod zip;

use std::io::IsTerminal;
use std::{env, io};

pub use dir::*;
pub use input::*;
pub use self_update::*;
pub use webp::*;

pub use self::keyring::*;
pub use self::zip::*;

pub fn support_osc94() -> bool {
    supports_term_integration() && is_terminal()
}

fn supports_term_integration() -> bool {
    let windows_terminal = env::var("WT_SESSION").is_ok();
    let conemu = env::var("ConEmuANSI").ok() == Some("ON".into());
    let wezterm = env::var("TERM_PROGRAM").ok() == Some("WezTerm".into());
    let ghostty = env::var("TERM_PROGRAM").ok() == Some("ghostty".into());

    windows_terminal || conemu || wezterm || ghostty
}

fn is_terminal() -> bool {
    io::stdout().is_terminal()
}