module

Term::Cursor

Constants

CSI = "\e["
DEC_RST = "l"
DEC_SET = "h"
DEC_TCEM = "?25"
ESC = "\e"
VERSION = "1.0.0"

Instance methods

backward(n : Int32 | Nil = nil)

Move the cursor backward by n

Source
clear_char(n : Int32 | Nil = nil)

Erase n characters from the current cursor position

Source
clear_line

Erase the entire current line and return to beginning of the line

Source
clear_line_after

Erase from the current position (inclusive) to the end of the line

Source
clear_line_before

Erase from the beginning of the line up to and including the current cursor position.

Source
clear_lines(n, direction = :up)

Clear a number of lines

Source
clear_rows(n, direction = :up)

ditto

Source
clear_screen

Clear the screen with the background colour and moves the cursor to home

Source
clear_screen_down

Clear screen down from current position

Source
clear_screen_up

Clear screen up from current position

Source
column(n : Int32 | Nil = nil)

Cursor moves to nth position horizontally in the current line

Source
current

Query cursor current position

Source
cursor_backward(n)

ditto

Source
cursor_down(n)

ditto

Source
cursor_forward(n)

ditto

Source
cursor_up(n)

ditto

Source
down(n : Int32 | Nil = nil)

Move the cursor down by n

Source
forward(n : Int32 | Nil = nil)

Move the cursor forward by n

Source
get_position(input = STDIN, output = STDOUT) : Tuple(Int32, Int32)

Get the current cursor position Returns a tuple with {row, column}

Source
hide

Hide cursor

Source
invisible(stream = STDOUT, &)

Switch off cursor for the block

Source
move(x, y)

Move cursor relative to its current position

Source
move_to(row : Int32 | Nil = nil, column : Int32 | Nil = nil) : String

Set the cursor absolute position

Source
next_line

Move cursor down to beginning of next line

Source
prev_line

Move cursor up to beginning of previous line

Source
restore

Restore cursor position

Source
row(n : Int32 | Nil = nil)

Cursor moves to the nth position vertically in the current column

Source
save

Save current position

Source
scroll_down

Scroll display down one line

Source
scroll_up

Scroll display up one line

Source
show

Make cursor visible

Source
up(n : Int32 | Nil = nil)

Move cursor up by n

Source