Package core
Class ShellHistory
java.lang.Object
core.ShellHistory
Manages the command history buffer and navigation (up/down arrows).
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ShellHistory
public ShellHistory()Constructs a new ShellHistory instance. Initializes the command history buffer and navigation index.
-
-
Method Details
-
add
Adds a command to history and resets the navigation index.- Parameters:
command- The command to add.
-
previous
Returns the previous command in history.- Returns:
- The previous command, or an empty string if none.
-
next
Returns the next command in history.- Returns:
- The next command, or an empty string if none.
-
resetIndex
public void resetIndex()Resets the navigation index to the most recent command.
-