class

Tui::Screen

Inherits Reference < Object

Constants

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 methods

columns(fallback : Int32 = 80) : Int32
Source
detect_winsize
Source
rows(fallback : Int32 = 24) : Int32
Source

Instance methods

clear
Source
hide_cursor
Source
read_key
Source
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.

Source
session
Source
show_cursor
Source
suspend
Source

Nested types