Skip to main content

Module input_state

Module input_state 

Source
Expand description

Input mode and prompt-input state for the Recursive TUI.

Contains the multi-mode input machinery: InputMode, the mutable PromptInputState buffer, double-press tracking for Esc/Ctrl+C, and history-ring management.

Structs§

DoublePressTracker
Tracks when the user last pressed Esc / Ctrl+C. Goal 147 maps a “double press within window” to a stronger action (real exit on the second Ctrl+C) while a single press triggers the context-dependent path (interrupt / clear buffer / pop modal).
PromptInputState
Mutable state of the multi-mode prompt input.

Enums§

InputMode
Which input mode the PromptInput is currently in.

Constants§

DOUBLE_PRESS_WINDOW
Default window for double-press detection (Esc / Ctrl+C). The runtime can override this via the RECURSIVE_TUI_DOUBLE_MS env var — see double_press_window.
HISTORY_CAPACITY
Maximum number of history entries to retain in the ringbuffer.

Functions§

double_press_window
Resolve the active double-press window. Reads RECURSIVE_TUI_DOUBLE_MS once per call (cheap; this is hit only on keypress) and falls back to DOUBLE_PRESS_WINDOW on parse failure.
strip_history_prefix