class

Tput::Features

Inherits Crystallabs::Helpers::Boolean / Crystallabs::Helpers::Logging / JSON::Serializable / Reference / Object

Terminal features auto-detection.

Involved in a terminal are the terminal emulator in use (Tput::Emulator) and the term type initialized/running in it (ENV["TERM"] usually).

After those two variables are known, the features autodetection is ran to figure out the final details of terminal's behavior.

Constants

Log = ::Log.for((self.name.gsub("::", '.')).underscore)

Constructors

new(pull : JSON::PullParser)
Source
new(tput : Tput)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

acsc
Source
acscr
Source
broken_acs?

Does the terminal have broken ACS chars?

Source
color?

Color support flag (a yes/no)

Source
detect_broken_acs

Detects whether terminal has broken ACS characters

Source
detect_number_of_colors

Detects number of colors supported by the terminal (2 - 16M)

Source
detect_padding
Source
detect_pc_rom_charset

Detects whether terminal supports PC ROM charset

Source
detect_setbuf
Source
detect_unicode

Detects Unicode support

Source
get_console_cp

Gets console codepage (Windows-specific)

Source
inspect(io)
Source
number_of_colors

Number of colors supported by the terminal

Source
padding?
Source
parse_acs

Parses terminal's ACS characters and returns ASCII->ACS and ACS->ASCII mappings.

Source
pc_rom_charset?

Does the terminal support PC ROM charset?

Source
setbuf?
Source
unicode?

Is unicode supported?

Source

Nested types