Raxol.Terminal.CommandProcessor (Raxol v2.0.1)
View SourceHandles command processing for the terminal emulator. This module is responsible for parsing, validating, and executing terminal commands.
Summary
Functions
Executes a parsed command on the emulator. Returns {:ok, updated_emulator} or {:error, reason}.
Handles command execution errors. Returns {:ok, updated_emulator} with error state or {:error, reason}.
Processes a command string and executes it on the emulator. Returns {:ok, updated_emulator} or {:error, reason}.
Validates command parameters against the emulator's current state. Returns {:ok, validated_params} or {:error, reason}.
Functions
@spec execute_command(Raxol.Terminal.Emulator.t(), map()) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, String.t()}
Executes a parsed command on the emulator. Returns {:ok, updated_emulator} or {:error, reason}.
@spec handle_command_error(Raxol.Terminal.Emulator.t(), String.t()) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, String.t()}
Handles command execution errors. Returns {:ok, updated_emulator} with error state or {:error, reason}.
@spec process_command(Raxol.Terminal.Emulator.t(), String.t()) :: {:ok, Raxol.Terminal.Emulator.t()} | {:error, String.t()}
Processes a command string and executes it on the emulator. Returns {:ok, updated_emulator} or {:error, reason}.
@spec validate_parameters(Raxol.Terminal.Emulator.t(), list(), atom()) :: {:ok, list()} | {:error, String.t()}
Validates command parameters against the emulator's current state. Returns {:ok, validated_params} or {:error, reason}.