class Tui::Screen

Defined in:

tui/screen.cr

Constant Summary

CLEAR = "\e[2J\e[H"
CTRL_C = '\u0003'
HIDE_CURSOR = "\e[?25l"
KEY_MAP = {'k' => :up, 'j' => :down, 'h' => :left, 'l' => :l, 'q' => :q, 'r' => :r, 'b' => :b, 'e' => :e, '/' => :slash}
SHOW_CURSOR = "\e[?25h"
TIOCGWINSZ = 21523_u64

Class Method Summary

Instance Method Summary

Class Method Detail

def self.columns(fallback : Int32 = 80) : Int32 #

def self.detect_winsize : Winsize | Nil #

def self.rows(fallback : Int32 = 24) : Int32 #

Instance Method Detail

def clear #

def hide_cursor #

def read_key : Symbol #

def read_line(initial : String = "", &render : String -> ) : String | Nil #

Reads a line of text for an inline prompt: printable characters are appended, backspace/DEL removes the last one, and any other key (Enter, arrows, letters, ...) submits the buffer. Esc/Ctrl-C is the only way to cancel. render is called after every change with the current buffer so the caller can redraw the prompt.


def session(&) #

def show_cursor #

def suspend(&) #