Raxol.Terminal.Cursor (Raxol v0.5.0)

View Source

Provides cursor manipulation functions for the terminal emulator. This module handles operations like moving the cursor, setting its visibility, and managing cursor state.

Summary

Functions

Gets the current cursor position.

Moves the cursor backward by the specified number of columns.

Moves the cursor down by the specified number of lines.

Moves the cursor down and to the beginning of the line.

Moves the cursor forward by the specified number of columns.

Moves the cursor left by the specified number of columns.

Moves the cursor right by the specified number of columns.

Moves the cursor to the specified position.

Moves the cursor to the specified row and column.

Moves the cursor to the specified position, taking into account the screen width and height.

Moves the cursor to the specified column.

Moves the cursor up by the specified number of lines.

Moves the cursor up and to the beginning of the line.

Sets the cursor shape.

Sets the cursor visibility.

Types

t()

@type t() :: %Raxol.Terminal.Cursor{
  position: {non_neg_integer(), non_neg_integer()},
  shape: atom(),
  visible: boolean()
}

Functions

get_position(emulator)

Gets the current cursor position.

move_backward(emulator, cols)

Moves the cursor backward by the specified number of columns.

move_down(emulator, lines)

Moves the cursor down by the specified number of lines.

move_down_and_home(emulator, lines)

Moves the cursor down and to the beginning of the line.

move_forward(emulator, cols)

Moves the cursor forward by the specified number of columns.

move_left(emulator, cols)

Moves the cursor left by the specified number of columns.

move_right(emulator, cols)

Moves the cursor right by the specified number of columns.

move_to(emulator, arg)

Moves the cursor to the specified position.

move_to(emulator, row, col)

Moves the cursor to the specified row and column.

move_to(cursor, arg, width, height)

@spec move_to(
  t(),
  {non_neg_integer(), non_neg_integer()},
  non_neg_integer(),
  non_neg_integer()
) :: t()

Moves the cursor to the specified position, taking into account the screen width and height.

move_to_column(emulator, col)

Moves the cursor to the specified column.

move_up(emulator, lines)

Moves the cursor up by the specified number of lines.

move_up_and_home(emulator, lines)

Moves the cursor up and to the beginning of the line.

set_shape(emulator, shape)

Sets the cursor shape.

set_visible(emulator, visible)

Sets the cursor visibility.