Raxol.Terminal.Commands.CSIHandler.CursorMovementHandler (Raxol v2.0.1)
View SourceHandles cursor movement operations for CSI sequences.
Provides full implementation of cursor movement commands integrating with the existing Raxol.Terminal.Cursor module for consistent cursor state management.
Supports all standard VT100/ANSI cursor movement sequences:
- Cursor Up (CUU)
- Cursor Down (CUD)
- Cursor Forward/Right (CUF)
- Cursor Backward/Left (CUB)
- Cursor Position (CUP)
- Horizontal and Vertical Position Absolute (HPA/VPA)
Summary
Functions
Checks if cursor is at the edge of the screen.
Gets the current cursor position.
Moves cursor backward (left) by specified amount. CUB - Cursor Backward
Sets cursor to specific column (Horizontal Position Absolute). HPA - Horizontal Position Absolute
Moves cursor down by specified amount. CUD - Cursor Down
Moves cursor forward (right) by specified amount. CUF - Cursor Forward
Sets cursor position from parameter list. CUP - Cursor Position
Sets cursor position directly with row and column. CUP - Cursor Position (Direct)
Sets cursor position directly without parameter validation. Used internally for absolute positioning.
Sets cursor to specific row (Vertical Position Absolute). VPA - Vertical Position Absolute
Moves cursor up by specified amount. CUU - Cursor Up
Types
@type cursor_amount() :: non_neg_integer()
@type cursor_position() :: {non_neg_integer(), non_neg_integer()}
@type emulator() :: Raxol.Terminal.Emulator.t()
Functions
@spec cursor_at_edge?(emulator()) :: %{ top: boolean(), bottom: boolean(), left: boolean(), right: boolean() }
Checks if cursor is at the edge of the screen.
@spec get_cursor_position(emulator()) :: cursor_position()
Gets the current cursor position.
@spec handle_cursor_backward(emulator(), cursor_amount()) :: {:ok, emulator()}
Moves cursor backward (left) by specified amount. CUB - Cursor Backward
@spec handle_cursor_column(emulator(), non_neg_integer()) :: {:ok, emulator()}
Sets cursor to specific column (Horizontal Position Absolute). HPA - Horizontal Position Absolute
@spec handle_cursor_down(emulator(), cursor_amount()) :: {:ok, emulator()}
Moves cursor down by specified amount. CUD - Cursor Down
@spec handle_cursor_forward(emulator(), cursor_amount()) :: {:ok, emulator()}
Moves cursor forward (right) by specified amount. CUF - Cursor Forward
@spec handle_cursor_position(emulator(), [non_neg_integer()]) :: {:ok, emulator()}
Sets cursor position from parameter list. CUP - Cursor Position
@spec handle_cursor_position(emulator(), non_neg_integer(), non_neg_integer()) :: {:ok, emulator()}
Sets cursor position directly with row and column. CUP - Cursor Position (Direct)
@spec handle_cursor_position_direct( emulator(), non_neg_integer(), non_neg_integer() ) :: {:ok, emulator()}
Sets cursor position directly without parameter validation. Used internally for absolute positioning.
@spec handle_cursor_row(emulator(), non_neg_integer()) :: {:ok, emulator()}
Sets cursor to specific row (Vertical Position Absolute). VPA - Vertical Position Absolute
@spec handle_cursor_up(emulator(), cursor_amount()) :: {:ok, emulator()}
Moves cursor up by specified amount. CUU - Cursor Up