Raxol.Terminal.HistoryBuffer (Raxol v2.0.1)
View SourceManages terminal command history buffer operations. This module handles the storage and retrieval of command history.
Summary
Functions
Adds a command to the history buffer.
Clears the command history.
Gets all commands in history.
Gets the command at the specified index.
Gets the maximum history size.
Gets the current history position.
Gets the history size.
Loads history from a file.
Creates a new history buffer with the specified maximum size.
Moves to the next command in history.
Moves to the previous command in history.
Saves the history to a file.
Sets the maximum history size.
Sets the history position.
Types
@type t() :: %Raxol.Terminal.HistoryBuffer{ commands: [String.t()], max_size: non_neg_integer(), position: integer() }
Functions
Adds a command to the history buffer.
Clears the command history.
Gets all commands in history.
Gets the command at the specified index.
@spec get_max_size(t()) :: non_neg_integer()
Gets the maximum history size.
Gets the current history position.
@spec get_size(t()) :: non_neg_integer()
Gets the history size.
Loads history from a file.
@spec new(non_neg_integer()) :: t()
Creates a new history buffer with the specified maximum size.
Moves to the next command in history.
Moves to the previous command in history.
Saves the history to a file.
@spec set_max_size(t(), non_neg_integer()) :: t()
Sets the maximum history size.
Sets the history position.