wijjit.terminal.ansi.ANSICursor

class wijjit.terminal.ansi.ANSICursor[source]

ANSI cursor control codes.

__init__()

Methods

__init__()

back([n])

Move cursor back n columns.

bell()

Emit terminal bell sound.

down([n])

Move cursor down n lines.

forward([n])

Move cursor forward n columns.

hide()

Hide the cursor.

position(row, col)

Move cursor to specific position.

restore_position()

Restore saved cursor position.

save_position()

Save current cursor position.

show()

Show the cursor.

up([n])

Move cursor up n lines.

static up(n=1)[source]

Move cursor up n lines.

Parameters:

n (int) – Number of lines to move up

Returns:

ANSI escape sequence

Return type:

str

static down(n=1)[source]

Move cursor down n lines.

Parameters:

n (int) – Number of lines to move down

Returns:

ANSI escape sequence

Return type:

str

static forward(n=1)[source]

Move cursor forward n columns.

Parameters:

n (int) – Number of columns to move forward

Returns:

ANSI escape sequence

Return type:

str

static back(n=1)[source]

Move cursor back n columns.

Parameters:

n (int) – Number of columns to move back

Returns:

ANSI escape sequence

Return type:

str

static position(row, col)[source]

Move cursor to specific position.

Parameters:
  • row (int) – Row position (1-indexed)

  • col (int) – Column position (1-indexed)

Returns:

ANSI escape sequence

Return type:

str

static hide()[source]

Hide the cursor.

Returns:

ANSI escape sequence

Return type:

str

static show()[source]

Show the cursor.

Returns:

ANSI escape sequence

Return type:

str

static save_position()[source]

Save current cursor position.

Returns:

ANSI escape sequence

Return type:

str

static restore_position()[source]

Restore saved cursor position.

Returns:

ANSI escape sequence

Return type:

str

static bell()[source]

Emit terminal bell sound.

Returns:

Bell control character

Return type:

str