Raxol.Terminal.Command.Manager (Raxol v0.5.0)

View Source

Manages terminal command state, history, and execution.

Summary

Types

t()

@type t() :: %Raxol.Terminal.Command.Manager{
  command_buffer: String.t(),
  command_history: [String.t()],
  history_index: integer(),
  last_key_event: term()
}

Functions

add_to_history(state, command)

Adds a command to the history.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

clear_command_buffer(pid \\ __MODULE__)

clear_command_history(pid \\ __MODULE__)

clear_history(state)

Clears the command history.

execute_command(pid \\ __MODULE__, command)

get_command_buffer(manager \\ %__MODULE__{})

Gets the current command buffer.

get_command_history(manager \\ %__MODULE__{})

Gets the command history.

get_command_state(pid \\ __MODULE__)

get_current_command(pid \\ __MODULE__)

get_history_command(state, index)

Gets a command from history by index.

get_last_key_event(state)

Gets the last key event.

new(opts \\ [])

process_key_event(state, key_event)

Processes a key event and updates the command buffer accordingly.

search_history(state, pattern)

Searches command history for a matching command.

set_command_state(pid \\ __MODULE__, state)

set_current_command(pid \\ __MODULE__, command)

start_link(opts \\ [])

update_command_buffer(state, new_buffer)

Updates the command buffer.

update_last_key_event(state, event)

Updates the last key event.