module Term::Cursor

Extended Modules

Defined in:

cursor/version.cr
term-cursor.cr

Constant Summary

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

Instance Method Summary

Instance Method Detail

def backward(n : Int32 | Nil = nil) #

Move the cursor backward by n


[View source]
def clear_char(n : Int32 | Nil = nil) #

Erase n characters from the current cursor position


[View source]
def clear_line #

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


[View source]
def clear_line_after #

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


[View source]
def clear_line_before #

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


[View source]
def clear_lines(n, direction = :up) #

Clear a number of lines


[View source]
def clear_rows(n, direction = :up) #

ditto


[View source]
def clear_screen #

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


[View source]
def clear_screen_down #

Clear screen down from current position


[View source]
def clear_screen_up #

Clear screen up from current position


[View source]
def column(n : Int32 | Nil = nil) #

Cursor moves to nth position horizontally in the current line


[View source]
def current #

Query cursor current position


[View source]
def cursor_backward(n) #

ditto


[View source]
def cursor_down(n) #

ditto


[View source]
def cursor_forward(n) #

ditto


[View source]
def cursor_up(n) #

ditto


[View source]
def down(n : Int32 | Nil = nil) #

Move the cursor down by n


[View source]
def forward(n : Int32 | Nil = nil) #

Move the cursor forward by n


[View source]
def get_position(input = STDIN, output = STDOUT) : Tuple(Int32, Int32) #

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


[View source]
def hide #

Hide cursor


[View source]
def invisible(stream = STDOUT, &) #

Switch off cursor for the block


[View source]
def move(x, y) #

Move cursor relative to its current position


[View source]
def move_to(row : Int32 | Nil = nil, column : Int32 | Nil = nil) : String #

Set the cursor absolute position


[View source]
def next_line #

Move cursor down to beginning of next line


[View source]
def prev_line #

Move cursor up to beginning of previous line


[View source]
def restore #

Restore cursor position


[View source]
def row(n : Int32 | Nil = nil) #

Cursor moves to the nth position vertically in the current column


[View source]
def save #

Save current position


[View source]
def scroll_down #

Scroll display down one line


[View source]
def scroll_up #

Scroll display up one line


[View source]
def show #

Make cursor visible


[View source]
def up(n : Int32 | Nil = nil) #

Move cursor up by n


[View source]