Interface IInputHistory
Interface for pluggable input history navigation. Allows terminal CLI components to navigate through previously entered input using up/down arrow keys without depending on a specific history implementation.
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public interface IInputHistory
Properties
IsNavigating
Navigates up (older) in the history.
Declaration
bool IsNavigating { get; }
Property Value
| Type | Description |
|---|---|
| bool | The command at the navigation position, or null if at the beginning. |
Remarks
A caller uses this to tell a meaningful Down keypress from one that has nowhere to go. Outside a walk there is nothing below the current line, so Down should leave the line, and anything drawn over it, exactly as they are.
Methods
Add(string)
Adds an entry to the history.
Declaration
void Add(string entry)
Parameters
| Type | Name | Description |
|---|---|---|
| string | entry | The input entry to add. |
NavigateDown()
Navigates down (newer) in the history.
Declaration
string NavigateDown()
Returns
| Type | Description |
|---|---|
| string | The command at the navigation position, or the saved input if past the newest. |
NavigateUp(string)
Declaration
string NavigateUp(string currentInput)
Parameters
| Type | Name | Description |
|---|---|---|
| string | currentInput |
Returns
| Type | Description |
|---|---|
| string |
ResetNavigation()
Resets the navigation state.
Declaration
void ResetNavigation()