Raxol.Terminal.Cursor (Raxol v2.0.1)
View SourceProvides 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.
Gets the cursor style.
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 relative to its current position.
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.
Creates a new cursor with default settings.
Resets the cursor color to default.
Restores the cursor to a previously saved position.
Saves the current cursor position.
Sets the cursor blink state.
Sets the cursor color.
Sets the cursor position.
Sets the cursor shape.
Sets the cursor style.
Sets the cursor visibility.
Sets the cursor visibility.
Checks if the cursor is visible.
Types
@type t() :: %Raxol.Terminal.Cursor{ position: {non_neg_integer(), non_neg_integer()}, saved_position: {non_neg_integer(), non_neg_integer()} | nil, shape: atom(), visible: boolean() }
Functions
@spec get_position(Raxol.Terminal.Emulator.Struct.t()) :: {non_neg_integer(), non_neg_integer()}
Gets the current cursor position.
@spec get_style(Raxol.Terminal.Emulator.Struct.t()) :: map()
Gets the cursor style.
@spec move_backward(Raxol.Terminal.Emulator.Struct.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.Struct.t()
Moves the cursor backward by the specified number of columns.
@spec move_down(Raxol.Terminal.Emulator.Struct.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.Struct.t()
Moves the cursor down by the specified number of lines.
@spec move_down_and_home(Raxol.Terminal.Emulator.Struct.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.Struct.t()
Moves the cursor down and to the beginning of the line.
@spec move_forward(Raxol.Terminal.Emulator.Struct.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.Struct.t()
Moves the cursor forward by the specified number of columns.
@spec move_left(Raxol.Terminal.Emulator.Struct.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.Struct.t()
Moves the cursor left by the specified number of columns.
Moves the cursor relative to its current position.
@spec move_right(Raxol.Terminal.Emulator.Struct.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.Struct.t()
Moves the cursor right by the specified number of columns.
@spec move_to( Raxol.Terminal.Emulator.Struct.t(), {non_neg_integer(), non_neg_integer()} ) :: Raxol.Terminal.Emulator.Struct.t()
Moves the cursor to the specified position.
@spec move_to( Raxol.Terminal.Emulator.Struct.t(), non_neg_integer(), non_neg_integer() ) :: Raxol.Terminal.Emulator.Struct.t()
Moves the cursor to the specified row and column.
@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.
@spec move_to_column(Raxol.Terminal.Emulator.Struct.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.Struct.t()
Moves the cursor to the specified column.
@spec move_up(Raxol.Terminal.Emulator.Struct.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.Struct.t()
Moves the cursor up by the specified number of lines.
@spec move_up_and_home(Raxol.Terminal.Emulator.Struct.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.Struct.t()
Moves the cursor up and to the beginning of the line.
@spec new() :: t()
Creates a new cursor with default settings.
@spec reset_color(Raxol.Terminal.Emulator.Struct.t()) :: Raxol.Terminal.Emulator.Struct.t()
Resets the cursor color to default.
Restores the cursor to a previously saved position.
Saves the current cursor position.
@spec set_blink(Raxol.Terminal.Emulator.Struct.t(), boolean()) :: Raxol.Terminal.Emulator.Struct.t()
Sets the cursor blink state.
@spec set_color(Raxol.Terminal.Emulator.Struct.t(), map()) :: Raxol.Terminal.Emulator.Struct.t()
Sets the cursor color.
@spec set_position( Raxol.Terminal.Emulator.Struct.t(), {non_neg_integer(), non_neg_integer()} ) :: Raxol.Terminal.Emulator.Struct.t()
Sets the cursor position.
@spec set_shape(Raxol.Terminal.Emulator.Struct.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.Struct.t()
Sets the cursor shape.
@spec set_style(Raxol.Terminal.Emulator.Struct.t(), map()) :: Raxol.Terminal.Emulator.Struct.t()
Sets the cursor style.
@spec set_visibility(Raxol.Terminal.Emulator.Struct.t(), boolean()) :: Raxol.Terminal.Emulator.Struct.t()
Sets the cursor visibility.
@spec set_visible(Raxol.Terminal.Emulator.Struct.t(), boolean()) :: Raxol.Terminal.Emulator.Struct.t()
Sets the cursor visibility.
@spec visible?(Raxol.Terminal.Emulator.Struct.t()) :: boolean()
Checks if the cursor is visible.