Raxol.Terminal.Command.Manager (Raxol v2.0.1)
View SourceManages terminal command processing and execution. This module is responsible for handling command parsing, validation, and execution.
Summary
Functions
Adds a command to the history.
Returns a specification to start this module under a supervisor.
Clears the command history.
Gets the current command. Returns the current command or nil.
Gets a command from history by index.
Gets the last key event.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.
Creates a new command manager.
Creates a new command manager with options.
Processes a command string. Returns the updated emulator and any output.
Processes a key event and updates the command buffer accordingly.
Searches command history for a matching command.
Sets the current command. Returns the updated emulator.
Updates the command buffer.
Updates the last key event.
Types
Functions
Adds a command to the history.
Returns a specification to start this module under a supervisor.
See Supervisor.
Clears the command history.
@spec get_current(Raxol.Terminal.Emulator.t()) :: String.t() | nil
Gets the current command. Returns the current command or nil.
Gets a command from history by index.
Gets the last key event.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.
Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.
@spec new() :: Raxol.Terminal.Command.t()
Creates a new command manager.
@spec new(keyword()) :: Raxol.Terminal.Command.t()
Creates a new command manager with options.
@spec process_command(Raxol.Terminal.Emulator.t(), String.t()) :: {Raxol.Terminal.Emulator.t(), any()}
Processes a command string. Returns the updated emulator and any output.
Processes a key event and updates the command buffer accordingly.
Searches command history for a matching command.
@spec set_current(Raxol.Terminal.Emulator.t(), String.t()) :: Raxol.Terminal.Emulator.t()
Sets the current command. Returns the updated emulator.
Updates the command buffer.
Updates the last key event.