Raxol.Terminal.Commands.EraseHandlers (Raxol v0.5.0)
View SourceHandles erase related CSI commands.
This module contains handlers for erase operations like ED (Erase in Display) and EL (Erase in Line). Each function takes the current emulator state and parsed parameters, returning the updated emulator state.
Summary
Functions
Helper function to get active buffer, cursor position, and default style. Returns a tuple of {active_buffer, cursor_pos, default_style}.
Helper function to handle erase operations. Takes the emulator, erase type, and erase parameters.
Handles Erase in Display (ED - 'J')
Handles Erase in Line (EL - 'K')
Functions
@spec get_buffer_state(Raxol.Terminal.Emulator.t()) :: {Raxol.Terminal.ScreenBuffer.t(), {integer(), integer()}, Raxol.Terminal.ANSI.TextFormatting.text_style()}
Helper function to get active buffer, cursor position, and default style. Returns a tuple of {active_buffer, cursor_pos, default_style}.
@spec handle_erase( Raxol.Terminal.Emulator.t(), :screen | :line, integer(), {integer(), integer()} ) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Helper function to handle erase operations. Takes the emulator, erase type, and erase parameters.
@spec handle_j(Raxol.Terminal.Emulator.t(), [integer()]) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles Erase in Display (ED - 'J')
@spec handle_k(Raxol.Terminal.Emulator.t(), [integer()]) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, atom(), Raxol.Terminal.Emulator.t()}
Handles Erase in Line (EL - 'K')