Raxol.Terminal.Emulator.Core (Raxol v0.3.0)

View Source

Core functionality for the terminal emulator. Handles basic initialization, state management, and fundamental operations.

Summary

Functions

Returns the currently active screen buffer.

Returns the current command buffer.

Returns the current command history.

Returns the current cursor position.

Returns the current icon name.

Returns the current output buffer.

Returns the current window state.

Returns the current window title.

Creates a new terminal emulator instance with the specified dimensions and options.

Types

cursor_style_type()

@type cursor_style_type() ::
  :blinking_block
  | :steady_block
  | :blinking_underline
  | :steady_underline
  | :blinking_bar
  | :steady_bar

t()

@type t() :: %Raxol.Terminal.Emulator.Core{
  active_buffer_type: :main | :alternate,
  alternate_screen_buffer: Raxol.Terminal.ScreenBuffer.t(),
  charset_state: Raxol.Terminal.ANSI.CharacterSets.charset_state(),
  command: CommandManager.t(),
  command_history: list(),
  current_command_buffer: String.t(),
  current_hyperlink_url: String.t() | nil,
  cursor: Raxol.Terminal.Command.Manager.t(),
  cursor_style: cursor_style_type(),
  height: non_neg_integer(),
  icon_name: String.t() | nil,
  last_key_event: map() | nil,
  main_screen_buffer: Raxol.Terminal.ScreenBuffer.t(),
  max_command_history: non_neg_integer(),
  memory_limit: non_neg_integer(),
  mode_manager: Raxol.Terminal.ModeManager.t(),
  options: map(),
  output_buffer: String.t(),
  parser_state: Raxol.Terminal.Parser.State.t(),
  plugin_manager: Raxol.Terminal.Plugins.PluginManager.t(),
  scroll_region: {non_neg_integer(), non_neg_integer()} | nil,
  state: StateManager.t(),
  style: Raxol.Terminal.ANSI.TextFormatting.text_style(),
  tab_stops: MapSet.t(),
  width: non_neg_integer(),
  window_state: window_state(),
  window_title: String.t() | nil
}

window_state()

@type window_state() :: %{
  title: String.t(),
  icon_name: String.t(),
  size: {non_neg_integer(), non_neg_integer()},
  position: {non_neg_integer(), non_neg_integer()},
  stacking_order: :normal | :maximized | :iconified,
  iconified: boolean(),
  maximized: boolean(),
  previous_size: {non_neg_integer(), non_neg_integer()} | nil
}

Functions

get_active_buffer(emulator)

@spec get_active_buffer(t()) :: Raxol.Terminal.ScreenBuffer.t()

Returns the currently active screen buffer.

get_command_buffer(emulator)

@spec get_command_buffer(t()) :: String.t()

Returns the current command buffer.

get_command_history(emulator)

@spec get_command_history(t()) :: list()

Returns the current command history.

get_cursor_position(emulator)

@spec get_cursor_position(t()) :: {non_neg_integer(), non_neg_integer()}

Returns the current cursor position.

get_icon_name(emulator)

@spec get_icon_name(t()) :: String.t() | nil

Returns the current icon name.

get_output_buffer(emulator)

@spec get_output_buffer(t()) :: String.t()

Returns the current output buffer.

get_window_state(emulator)

@spec get_window_state(t()) :: window_state()

Returns the current window state.

get_window_title(emulator)

@spec get_window_title(t()) :: String.t() | nil

Returns the current window title.

new(width \\ 80, height \\ 24, opts \\ [])

@spec new(non_neg_integer(), non_neg_integer(), keyword()) :: t()

Creates a new terminal emulator instance with the specified dimensions and options.