Raxol.Minimal (Raxol v2.0.1)

View Source

Minimal Raxol terminal interface for ultra-fast startup.

This module provides a stripped-down version of Raxol optimized for minimal startup time and memory footprint while still providing core terminal functionality.

Features Included

  • Core terminal emulation with full ANSI/CSI support
  • Efficient buffer management with scrollback
  • Keyboard/mouse input handling
  • Performance telemetry
  • Character sets (UTF-8, ASCII)
  • Color support (16/256/RGB)

Features Excluded

  • Web interface (Phoenix)
  • Database layer
  • Advanced animations
  • Plugin system (unless explicitly enabled)
  • Audit logging
  • Enterprise features

Usage

# Start minimal terminal
{:ok, terminal} = Raxol.Minimal.start_terminal()

# Or start with options
{:ok, terminal} = Raxol.Minimal.start_terminal(
  width: 80,
  height: 24,
  mode: :raw,
  features: [:colors, :scrollback]
)

Configuration

The minimal terminal can be configured via application environment:

config :raxol, Raxol.Minimal,
  default_width: 80,
  default_height: 24,
  max_scrollback: 1000,
  enable_telemetry: true

Summary

Functions

Returns a specification to start this module under a supervisor.

Clear the terminal screen.

Get terminal dimensions.

Get performance metrics.

Get current terminal state for debugging.

Reset terminal to initial state.

Resize the terminal.

Send input to terminal.

Start a minimal terminal session with ultra-fast startup.

Types

color_mode()

@type color_mode() :: :none | :ansi16 | :ansi256 | :rgb

feature()

@type feature() ::
  :colors | :scrollback | :mouse | :bracketed_paste | :alternate_screen

terminal_mode()

@type terminal_mode() :: :raw | :cooked | :cbreak

terminal_options()

@type terminal_options() :: [
  width: pos_integer(),
  height: pos_integer(),
  mode: terminal_mode(),
  color_mode: color_mode(),
  features: [feature()],
  scrollback_lines: non_neg_integer(),
  charset: :utf8 | :ascii,
  telemetry: boolean(),
  hibernate_after: timeout()
]

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

clear(pid)

@spec clear(pid()) :: :ok

Clear the terminal screen.

get_dimensions(pid)

@spec get_dimensions(pid()) :: {pos_integer(), pos_integer()}

Get terminal dimensions.

get_metrics(pid)

@spec get_metrics(pid()) :: map()

Get performance metrics.

get_state(pid)

@spec get_state(pid()) :: map()

Get current terminal state for debugging.

reset(pid)

@spec reset(pid()) :: :ok

Reset terminal to initial state.

resize(pid, width, height)

@spec resize(pid(), pos_integer(), pos_integer()) :: :ok

Resize the terminal.

send_input(pid, data)

@spec send_input(pid(), binary()) :: :ok

Send input to terminal.

start_link(init_opts \\ [])

start_terminal(opts \\ [])

@spec start_terminal(terminal_options()) :: {:ok, pid()} | {:error, term()}

Start a minimal terminal session with ultra-fast startup.

Returns {:ok, pid} on success.