module

Opal::Terminal::Screen

Screen control and ANSI terminal escape codes.

Constants

CLEAR_ALL = "\e[2J"

Clearing

CLEAR_DOWN = "\e[0J"
CLEAR_LINE = "\e[2K"
CLEAR_LINE_LEFT = "\e[1K"
CLEAR_LINE_RIGHT = "\e[0K"
CSI = "\e["
CURSOR_HOME = "\e[H"
DISABLE_MOUSE = "\e[?1006l\e[?1002l\e[?1000l"
ENABLE_MOUSE = "\e[?1000h\e[?1002h\e[?1006h"

Mouse tracking (SGR mode 1006 with button event 1002 and normal tracking 1000)

ENTER_ALT_BUFFER = "\e[?1049h"

Screen buffer controls

ESC = "\e"
EXIT_ALT_BUFFER = "\e[?1049l"
HIDE_CURSOR = "\e[?25l"

Cursor visibility

RESET_FORMAT = "\e[0m"
SHOW_CURSOR = "\e[?25h"

Class methods

move_backward(n : Int32 = 1) : String

Returns an escape code to move the cursor backward n columns.

Source
move_down(n : Int32 = 1) : String

Returns an escape code to move the cursor down n lines.

Source
move_forward(n : Int32 = 1) : String

Returns an escape code to move the cursor forward n columns.

Source
move_to(row : Int32, col : Int32) : String

Returns an escape code to position the cursor at (row, col) (1-indexed).

Source
move_up(n : Int32 = 1) : String

Returns an escape code to move the cursor up n lines.

Source
set_title(title : String) : String

Returns an escape code to set the terminal window title.

Source