pub fn supports_ansi() -> bool {
    INITIALIZER.call_once(|| {
        // Some terminals on Windows like GitBash can't use WinAPI calls directly
        // so when we try to enable the ANSI-flag for Windows this won't work.
        // Because of that we should check first if the TERM-variable is set
        // and see if the current terminal is a terminal who does support ANSI.
        let supported = std::env::var("TERM").map_or(false, |term| term != "dumb")
            || enable_vt_processing().is_ok();

        SUPPORTS_ANSI_ESCAPE_CODES.store(supported, Ordering::SeqCst);
    });

    SUPPORTS_ANSI_ESCAPE_CODES.load(Ordering::SeqCst)
}
/// Checks if the current terminal supports ansi escape sequences
Checks if the current terminal supports ansi escape sequences
Checks if the current terminal supports ansi escape sequences
pub fn supports_ansi() -> bool {
    INITIALIZER.call_once(|| {
        // Some terminals on Windows like GitBash can't use WinAPI calls directly
        // so when we try to enable the ANSI-flag for Windows this won't work.
        // Because of that we should check first if the TERM-variable is set
        // and see if the current terminal is a terminal who does support ANSI.
        let supported = std::env::var("TERM").map_or(false, |term| term != "dumb")
            || enable_vt_processing().is_ok();
        SUPPORTS_ANSI_ESCAPE_CODES.store(supported, Ordering::SeqCst);
    });
    SUPPORTS_ANSI_ESCAPE_CODES.load(Ordering::SeqCst)
}
pub fn supports_ansi ( ) -> bool { INITIALIZER . call_once ( | | { // Some terminals on Windows like GitBash can't use WinAPI calls directly // so when we try to enable the ANSI-flag for Windows this won't work. // Because of that we should check first if the TERM-variable is set // and see if the current terminal is a terminal who does support ANSI. let supported = std :: env :: var ( " " ) . map_or ( false , | term | term != " " ) || enable_vt_processing ( ) . is_ok ( ) ; SUPPORTS_ANSI_ESCAPE_CODES . store ( supported , Ordering :: SeqCst ) ; } ) ; SUPPORTS_ANSI_ESCAPE_CODES . load ( Ordering :: SeqCst ) }
Checks if the current terminal supports ansi escape sequences
Checks if the current terminal supports ansi escape sequences