Raxol.Terminal.Commands.EraseHandlers (Raxol v0.4.0)

View Source

Handles 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

get_buffer_state(emulator)

Helper function to get active buffer, cursor position, and default style. Returns a tuple of {active_buffer, cursor_pos, default_style}.

handle_erase(emulator, type, erase_param, arg)

@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.

handle_J(emulator, params)

@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')

handle_K(emulator, params)

@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')