Raxol.Terminal.Commands.BufferHandlers (Raxol v0.3.0)

View Source

Handles buffer manipulation related CSI commands.

This module contains handlers for buffer operations like insert/delete lines, insert/delete characters, and erase operations. 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}.

Handles Insert Character (ICH - '@')

Handles Insert Line (IL - 'L')

Handles Delete Line (DL - 'M')

Handles Delete Character (DCH - 'P')

Handles Erase Character (ECH - 'X')

Helper function to perform a buffer operation and update the emulator. Takes the emulator, a function that performs the buffer operation, and any additional arguments needed by the operation function.

Functions

get_buffer_state(emulator)

@spec get_buffer_state(Raxol.Terminal.Emulator.t()) ::
  {Raxol.Terminal.ScreenBuffer.t(), {integer(), integer()},
   Raxol.Terminal.Cell.style()}

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

handle_at(emulator, params)

Handles Insert Character (ICH - '@')

handle_L(emulator, params)

Handles Insert Line (IL - 'L')

handle_M(emulator, params)

Handles Delete Line (DL - 'M')

handle_P(emulator, params)

Handles Delete Character (DCH - 'P')

handle_X(emulator, params)

Handles Erase Character (ECH - 'X')

with_buffer_operation(emulator, operation_fn, operation_args)

Helper function to perform a buffer operation and update the emulator. Takes the emulator, a function that performs the buffer operation, and any additional arguments needed by the operation function.