
use core

global ansi_supported : u8 (0)

+ fn supported() bool {
    if ansi_supported > 0 : return ansi_supported == 1
    let term = core:getenv("TERM") ! return false
    let supported = term.contains("xterm") || term.contains("vt") || term.contains("ansi")
    || term.contains("linux") || term.contains("screen") || term.contains("tmux")
    ansi_supported = supported ? 1 : 2
    return supported
}
