Raxol.Terminal.Cursor.Manager (Raxol v2.0.1)
View SourceManages cursor state and operations in the terminal. Handles cursor position, visibility, style, and blinking state.
Summary
Functions
Returns a specification to start this module under a supervisor.
Gets the current cursor position.
Gets the cursor position as a tuple {row, col}.
Gets the cursor visibility state.
Moves the cursor relative to its current position.
Moves the cursor down by the specified number of lines. Returns the updated emulator.
Moves the cursor left by the specified number of columns. Returns the updated emulator.
Moves the cursor right by the specified number of columns. Returns the updated emulator.
Moves the cursor to a specific position.
Moves the cursor to a specific position with bounds clamping.
Moves the cursor up by the specified number of lines. Returns the updated emulator.
Creates a new cursor manager instance.
Creates a new cursor manager.
Sets the cursor position.
Sets the cursor visibility state.
Updates the cursor position after a resize operation. Returns the updated emulator.
Updates the scroll region after a resize operation. Returns the updated emulator.
Types
@type color() :: {non_neg_integer(), non_neg_integer(), non_neg_integer()} | nil
@type cursor_style() :: :block | :underline | :bar
@type t() :: %Raxol.Terminal.Cursor.Manager{ blink: boolean(), blink_rate: non_neg_integer(), blink_timer: non_neg_integer() | nil, blinking: boolean(), bottom_margin: non_neg_integer(), col: non_neg_integer(), color: color(), custom_dimensions: {non_neg_integer(), non_neg_integer()} | nil, custom_shape: atom() | nil, history: list(), history_index: non_neg_integer(), history_limit: non_neg_integer(), position: {non_neg_integer(), non_neg_integer()}, row: non_neg_integer(), saved_blinking: boolean() | nil, saved_col: non_neg_integer() | nil, saved_color: color() | nil, saved_position: {non_neg_integer(), non_neg_integer()} | nil, saved_row: non_neg_integer() | nil, saved_style: cursor_style() | nil, saved_visible: boolean() | nil, shape: {non_neg_integer(), non_neg_integer()}, state: atom(), style: cursor_style(), top_margin: non_neg_integer(), visible: boolean() }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec emulator_blinking?(Raxol.Terminal.Emulator.t()) :: boolean()
@spec emulator_visible?(Raxol.Terminal.Emulator.t()) :: boolean()
@spec get_emulator_position(Raxol.Terminal.Emulator.t()) :: {integer(), integer()}
@spec get_emulator_style(Raxol.Terminal.Emulator.t()) :: atom()
Gets the current cursor position.
Gets the cursor position as a tuple {row, col}.
Gets the cursor visibility state.
Moves the cursor relative to its current position.
@spec move_down(Raxol.Terminal.Emulator.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.t()
Moves the cursor down by the specified number of lines. Returns the updated emulator.
@spec move_left(Raxol.Terminal.Emulator.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.t()
Moves the cursor left by the specified number of columns. Returns the updated emulator.
@spec move_right(Raxol.Terminal.Emulator.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.t()
Moves the cursor right by the specified number of columns. Returns the updated emulator.
Moves the cursor to a specific position.
Moves the cursor to a specific position with bounds clamping.
@spec move_up(Raxol.Terminal.Emulator.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.t()
Moves the cursor up by the specified number of lines. Returns the updated emulator.
Creates a new cursor manager instance.
Creates a new cursor manager.
See Raxol.Terminal.Cursor.CursorState.restore_from_history/1.
@spec set_emulator_blink(Raxol.Terminal.Emulator.t(), boolean()) :: Raxol.Terminal.Emulator.t()
@spec set_emulator_position( Raxol.Terminal.Emulator.t(), non_neg_integer(), non_neg_integer() ) :: Raxol.Terminal.Emulator.t()
@spec set_emulator_style(Raxol.Terminal.Emulator.t(), atom()) :: Raxol.Terminal.Emulator.t()
@spec set_emulator_visibility(Raxol.Terminal.Emulator.t(), boolean()) :: Raxol.Terminal.Emulator.t()
Sets the cursor position.
Sets the cursor visibility state.
@spec update_cursor_position( Raxol.Terminal.Emulator.t(), non_neg_integer(), non_neg_integer() ) :: Raxol.Terminal.Emulator.t()
Updates the cursor position after a resize operation. Returns the updated emulator.
See Raxol.Terminal.Cursor.CursorState.update_position_from_text/2.
@spec update_scroll_region_for_resize(Raxol.Terminal.Emulator.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.t()
Updates the scroll region after a resize operation. Returns the updated emulator.