Raxol.Terminal.EmulatorLite (Raxol v2.0.1)
View SourceLightweight terminal emulator for performance-critical paths.
This is a pure struct-based emulator without GenServer processes, designed for fast parsing and simple terminal operations.
For full-featured terminal emulation with state management and concurrent operations, use Raxol.Terminal.Emulator.
Summary
Functions
Gets the active screen buffer.
Moves the cursor to a specific position.
Updates the cursor position relatively.
Creates a new lightweight emulator with minimal overhead.
Creates a minimal emulator for fastest possible parsing. No history, no alternate buffer, minimal features.
Resets the emulator to initial state.
Resizes the emulator to new dimensions.
Switches between main and alternate screen buffers.
Updates the active screen buffer.
Types
@type t() :: %Raxol.Terminal.EmulatorLite{ active_buffer_type: :main | :alternate, alternate_screen_buffer: Raxol.Terminal.ScreenBuffer.t() | nil, charset_state: map(), client_options: map(), command_history: list() | nil, current_command_buffer: String.t() | nil, cursor: Raxol.Terminal.Cursor.t(), cursor_style: atom(), height: non_neg_integer(), last_col_exceeded: boolean(), main_screen_buffer: Raxol.Terminal.ScreenBuffer.t(), max_command_history: non_neg_integer(), mode_manager: Raxol.Terminal.ModeManager.t(), mode_state: map(), output_buffer: String.t(), parser_state: any(), saved_cursor: Raxol.Terminal.Cursor.t() | nil, saved_style: Raxol.Terminal.ANSI.TextFormatting.t() | nil, scroll_region: {non_neg_integer(), non_neg_integer()} | nil, scrollback_buffer: list(), scrollback_limit: non_neg_integer(), session_id: String.t() | nil, style: Raxol.Terminal.ANSI.TextFormatting.t(), width: non_neg_integer(), window_state: map(), window_title: String.t() | nil }
Functions
@spec get_active_buffer(t()) :: Raxol.Terminal.ScreenBuffer.t()
Gets the active screen buffer.
@spec move_cursor(t(), non_neg_integer(), non_neg_integer()) :: t()
Moves the cursor to a specific position.
Updates the cursor position relatively.
@spec new(non_neg_integer(), non_neg_integer(), keyword()) :: t()
Creates a new lightweight emulator with minimal overhead.
Options:
- :enable_history - Enable command history tracking (default: false)
- :scrollback_limit - Number of scrollback lines (default: 1000)
- :alternate_buffer - Create alternate screen buffer (default: false)
@spec new_minimal(non_neg_integer(), non_neg_integer()) :: t()
Creates a minimal emulator for fastest possible parsing. No history, no alternate buffer, minimal features.
Resets the emulator to initial state.
@spec resize(t(), non_neg_integer(), non_neg_integer()) :: t()
Resizes the emulator to new dimensions.
Switches between main and alternate screen buffers.
@spec update_active_buffer(t(), (Raxol.Terminal.ScreenBuffer.t() -> Raxol.Terminal.ScreenBuffer.t())) :: t()
Updates the active screen buffer.