module Terminal

Extended Modules

Defined in:

styles.cr
terminal.cr

Instance Method Summary

Instance Method Detail

def highlight(source : String, language : String, theme : String | Nil) : String #

[View source]
def parse_color(color) : Array(Int32) | Nil #

Parse an X11-style color reply like "rgb:1c1c/1c1c/1c1c" into [red, green, blue], or nil if it doesn't parse


[View source]
def query_terminal(color) : String #

Query a terminal color via OSC and read the reply. If the terminal never replies (some don't support the query), time out instead of blocking forever.


[View source]
def show_image(path : String) : String #

[View source]
def supports_images? : Bool #

[View source]
def supports_links? : Bool #

[View source]
def terminal_light? : Bool #

[View source]
def terminal_width : Int32 | Nil #

Get terminal width, with fallback Returns nil if not in a TTY or unable to determine


[View source]
def theme(name : String | Nil = nil) : Hash(String, Style) #

[View source]