Raxol.UI.Components.Terminal.Emulator (Raxol v0.4.0)

View Source

Terminal emulator component wrapping the core emulator logic.

Summary

Functions

Gets the visible content from the UI component's state.

Handles terminal resize events by delegating to the CoreEmulator. This ensures that the terminal's internal buffers and state are correctly adjusted while preserving existing content and history where possible.

Initializes a new terminal emulator component state. Accepts an optional map of options, currently supporting :width and :height.

Processes input and updates terminal state by delegating to the core emulator. Returns a tuple {updated_state, output_string}.

Types

emulator_state()

@type emulator_state() :: %{core_emulator: Raxol.Terminal.Emulator.t()}

Functions

get_visible_content(state)

@spec get_visible_content(emulator_state()) :: list()

Gets the visible content from the UI component's state.

handle_resize(arg, state)

@spec handle_resize(
  {integer(), integer()},
  emulator_state()
) :: emulator_state()

Handles terminal resize events by delegating to the CoreEmulator. This ensures that the terminal's internal buffers and state are correctly adjusted while preserving existing content and history where possible.

init(opts \\ %{})

@spec init(map()) :: emulator_state()

Initializes a new terminal emulator component state. Accepts an optional map of options, currently supporting :width and :height.

process_input(input, state)

@spec process_input(term(), emulator_state()) :: {emulator_state(), term()}

Processes input and updates terminal state by delegating to the core emulator. Returns a tuple {updated_state, output_string}.