class
Tui::Screen
- Tui::Screen
- Reference
- Object
Defined in:
tui/screen.crConstant 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
- .columns(fallback : Int32 = 80) : Int32
- .detect_winsize : Winsize | Nil
- .rows(fallback : Int32 = 24) : Int32
Instance Method Summary
- #clear
- #hide_cursor
- #read_key : Symbol
-
#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.
- #session(&)
- #show_cursor
- #suspend(&)
Class Method Detail
Instance Method Detail
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.