Raxol.Terminal.Commands.CursorHandler (Raxol v2.0.1)
View SourceHandles cursor movement related CSI commands.
This module contains handlers for cursor movement commands like CUP, CUU, CUD, etc. Each function takes the current emulator state and parsed parameters, returning the updated emulator state.
Summary
Functions
Handles CSI A - Cursor Up (CUU)
Handles Cursor Up (CUU - 'A')
Handles CSI B - Cursor Down (CUD)
Handles Cursor Down (CUD - 'B') - alias for handle_B
Handles CSI C - Cursor Forward (CUF)
Handles Cursor Forward (CUF - 'C') - alias for handle_C
Handles Cursor Position (CUP - 'H")
Handles CSI D - Cursor Back (CUB)
Handles Cursor Vertical Absolute (VPA - 'd') - alias for handle_decvpa
Handles Cursor Backward (CUB - 'D') - alias for handle_D
Handles Cursor Vertical Absolute (VPA - 'd")
Handles CSI E - Cursor Next Line (CNL) Moves cursor to beginning of line n lines down
Handles Cursor Next Line (CNL - 'E').
Handles CSI F - Cursor Previous Line (CPL) Moves cursor to beginning of line n lines up
Handles Cursor Previous Line (CPL - 'F').
Handles Cursor Previous Line (CPL - 'F') - alias for handle_f.
Handles CSI G - Cursor Horizontal Absolute (CHA)
Handles Cursor Horizontal Absolute (CHA - 'G').
Handles Cursor Horizontal Absolute (CHA - 'G') - alias for handle_g.
Handles CSI H - Cursor Position (CUP) Sets cursor position to row;column
Handles Cursor Position (CUP - 'H') - alias for handle_cup
Moves the cursor back by the specified number of columns.
Moves the cursor down by the specified number of lines.
Moves the cursor down by the specified number of lines with width and height bounds.
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 a specific position.
Moves the cursor to a specific position with width and height bounds.
Moves the cursor to a specific column.
Moves the cursor to the start of the current line.
Moves the cursor up by the specified number of lines.
Moves the cursor up by the specified number of lines with width and height bounds.
Functions
Handles CSI A - Cursor Up (CUU)
@spec handle_a_alias(Raxol.Terminal.Emulator.t(), [integer()]) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles Cursor Up (CUU - 'A')
Handles CSI B - Cursor Down (CUD)
@spec handle_b_alias(Raxol.Terminal.Emulator.t(), [integer()]) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles Cursor Down (CUD - 'B') - alias for handle_B
Handles CSI C - Cursor Forward (CUF)
@spec handle_c_alias(Raxol.Terminal.Emulator.t(), [integer()]) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles Cursor Forward (CUF - 'C') - alias for handle_C
@spec handle_cup(Raxol.Terminal.Emulator.t(), [integer()]) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles Cursor Position (CUP - 'H")
@spec handle_cursor_movement( Raxol.Terminal.Emulator.t(), atom(), integer() ) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles CSI D - Cursor Back (CUB)
@spec handle_d(Raxol.Terminal.Emulator.t(), [integer()]) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles Cursor Vertical Absolute (VPA - 'd') - alias for handle_decvpa
@spec handle_d_alias(Raxol.Terminal.Emulator.t(), [integer()]) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles Cursor Backward (CUB - 'D') - alias for handle_D
@spec handle_decvpa(Raxol.Terminal.Emulator.t(), [integer()]) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles Cursor Vertical Absolute (VPA - 'd")
Handles CSI E - Cursor Next Line (CNL) Moves cursor to beginning of line n lines down
@spec handle_e_alias(Raxol.Terminal.Emulator.t(), [integer()]) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles Cursor Next Line (CNL - 'E').
Handles CSI F - Cursor Previous Line (CPL) Moves cursor to beginning of line n lines up
@spec handle_f(Raxol.Terminal.Emulator.t(), [integer()]) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles Cursor Previous Line (CPL - 'F').
@spec handle_f_alias(Raxol.Terminal.Emulator.t(), [integer()]) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles Cursor Previous Line (CPL - 'F') - alias for handle_f.
Handles CSI G - Cursor Horizontal Absolute (CHA)
@spec handle_g(Raxol.Terminal.Emulator.t(), [integer()]) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles Cursor Horizontal Absolute (CHA - 'G').
@spec handle_g_alias(Raxol.Terminal.Emulator.t(), [integer()]) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles Cursor Horizontal Absolute (CHA - 'G') - alias for handle_g.
Handles CSI H - Cursor Position (CUP) Sets cursor position to row;column
@spec handle_h_alias(Raxol.Terminal.Emulator.t(), [integer()]) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles Cursor Position (CUP - 'H') - alias for handle_cup
@spec move_cursor_back(Raxol.Terminal.Emulator.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.t()
Moves the cursor back by the specified number of columns.
@spec move_cursor_down(Raxol.Terminal.Emulator.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.t()
Moves the cursor down by the specified number of lines.
@spec move_cursor_down( Raxol.Terminal.Emulator.t(), non_neg_integer(), non_neg_integer(), non_neg_integer() ) :: Raxol.Terminal.Emulator.t()
Moves the cursor down by the specified number of lines with width and height bounds.
@spec move_cursor_forward(Raxol.Terminal.Emulator.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.t()
Moves the cursor forward by the specified number of columns.
@spec move_cursor_left( Raxol.Terminal.Emulator.t(), non_neg_integer(), non_neg_integer(), non_neg_integer() ) :: Raxol.Terminal.Emulator.t()
Moves the cursor left by the specified number of columns.
@spec move_cursor_right( Raxol.Terminal.Emulator.t(), non_neg_integer(), non_neg_integer(), non_neg_integer() ) :: Raxol.Terminal.Emulator.t()
Moves the cursor right by the specified number of columns.
@spec move_cursor_to(Raxol.Terminal.Emulator.t(), integer(), integer()) :: Raxol.Terminal.Emulator.t()
Moves the cursor to a specific position.
@spec move_cursor_to( Raxol.Terminal.Emulator.t(), {integer(), integer()}, integer(), integer() ) :: Raxol.Terminal.Emulator.t()
Moves the cursor to a specific position with width and height bounds.
@spec move_cursor_to_column( Raxol.Terminal.Emulator.t(), non_neg_integer(), non_neg_integer(), non_neg_integer() ) :: Raxol.Terminal.Emulator.t()
Moves the cursor to a specific column.
@spec move_cursor_to_line_start(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.Emulator.t()
Moves the cursor to the start of the current line.
@spec move_cursor_up(Raxol.Terminal.Emulator.t(), non_neg_integer()) :: Raxol.Terminal.Emulator.t()
Moves the cursor up by the specified number of lines.
@spec move_cursor_up( Raxol.Terminal.Emulator.t(), non_neg_integer(), non_neg_integer(), non_neg_integer() ) :: Raxol.Terminal.Emulator.t()
Moves the cursor up by the specified number of lines with width and height bounds.