Raxol.Terminal.Command.Manager (Raxol v0.4.0)
View SourceManages terminal command history and processing, including command buffer, history, and command execution.
Summary
Functions
Adds a command to the history, maintaining the maximum history size.
Clears the command history.
Gets the current command buffer.
Gets the command history.
Gets a command from history by index (0-based). Returns nil if index is out of bounds.
Gets the last key event.
Creates a new command manager with default values.
Processes a key event and updates the command buffer accordingly. Returns {new_manager, command_to_execute} where command_to_execute is nil if no command should be executed.
Searches command history for commands matching the given prefix. Returns a list of matching commands.
Updates the current command buffer.
Updates the last key event.
Updates the maximum command history size. If the new size is smaller than the current history, older commands are removed.
Types
@type t() :: %Raxol.Terminal.Command.Manager{ command_history: [String.t()], current_command_buffer: String.t(), last_key_event: map() | nil, max_command_history: non_neg_integer() }
Functions
Adds a command to the history, maintaining the maximum history size.
Clears the command history.
Gets the current command buffer.
Gets the command history.
Gets a command from history by index (0-based). Returns nil if index is out of bounds.
Gets the last key event.
Creates a new command manager with default values.
Processes a key event and updates the command buffer accordingly. Returns {new_manager, command_to_execute} where command_to_execute is nil if no command should be executed.
Searches command history for commands matching the given prefix. Returns a list of matching commands.
Updates the current command buffer.
Updates the last key event.
Updates the maximum command history size. If the new size is smaller than the current history, older commands are removed.