module Terminal
Extended Modules
Defined in:
styles.crterminal.cr
Instance Method Summary
- #highlight(source : String, language : String, theme : String | Nil) : String
-
#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
-
#query_terminal(color) : String
Query a terminal color via OSC and read the reply.
- #show_image(path : String) : String
- #supports_images? : Bool
- #supports_links? : Bool
- #terminal_light? : Bool
-
#terminal_width : Int32 | Nil
Get terminal width, with fallback Returns nil if not in a TTY or unable to determine
- #theme(name : String | Nil = nil) : Hash(String, Style)
Instance Method Detail
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
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.
def terminal_width : Int32 | Nil
#
Get terminal width, with fallback Returns nil if not in a TTY or unable to determine