struct Term::Color::Support

Defined in:

color/support.cr

Constant Summary

ENV_VARS = ["COLORTERM", "ANSICON"] of ::String
TERM_REGEX = /\ color| # explicitly claims color support in the name direct| # explicitly claims "direct color" (24 bit) support #{Mode::TERM_256}| #{Mode::TERM_64}| #{Mode::TERM_52}| #{Mode::TERM_16}| #{Mode::TERM_8}| ^ansi(\.sys.*)?$| ^cygwin| ^linux| ^putty| ^rxvt| ^screen| ^tmux| ^xterm| ^ms\-terminal/ix

Constructors

Instance Method Summary

Constructor Detail

def self.new(env : Hash(String, String), verbose : Bool = false) #

[View source]

Instance Method Detail

def disabled? #

Detect if color support has been disabled with NO_COLOR ENV var.


[View source]
def from_curses(curses_class = Curses) #

Attempt to load curses to check color support

TODO Implement from_curses


[View source]
def from_env #

Check if environment specifies color variables


[View source]
def from_term #

Inspect environment $TERM variable for color support


[View source]
def from_tput #

Shell out to tput to check color support


[View source]
def from_windows_term #

[View source]
def support? #

Detect if terminal supports color


[View source]