module

Term2::Cursor

Cursor module provides escape sequence strings for cursor control. Unlike Terminal module methods which print directly, these return strings that can be used in string building/concatenation.

Example:

io << Cursor.move_to(1, 1) << "Hello" << Cursor.move_to(2, 1) << "World"

Class methods

clear

Clear screen and move to home (convenience)

Source
column(n : Int32) : String

Move cursor to column n

Source
down(n : Int32 = 1) : String

Move cursor down n lines

Source
enter_alt_screen

Enter alternate screen buffer

Source
erase_line

Erase entire line

Source
erase_line_left

Erase from start of line to cursor

Source
erase_line_right

Erase from cursor to end of line

Source
erase_screen

Erase entire screen

Source
erase_screen_above

Erase from start of screen to cursor

Source
erase_screen_below

Erase from cursor to end of screen

Source
exit_alt_screen

Exit alternate screen buffer

Source
hide

Hide cursor

Source
home

Move cursor to home position (top-left)

Source
left(n : Int32 = 1) : String

Move cursor left n columns

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

Move cursor to specific position (row, col are 1-based)

Source
next_line(n : Int32 = 1) : String

Move cursor to beginning of line n lines down

Source
prev_line(n : Int32 = 1) : String

Move cursor to beginning of line n lines up

Source
request_position

Request cursor position (terminal will respond with position)

Source
reset

Reset all attributes

Source
restore

Restore cursor position

Source
right(n : Int32 = 1) : String

Move cursor right n columns

Source
save

Save cursor position

Source
set_title(title : String) : String

Set window title

Source
show

Show cursor

Source
up(n : Int32 = 1) : String

Move cursor up n lines

Source