Expand description
The main loop, minus the terminal.
run() sets up the terminal and hands EventPump::run a way to draw. Keys
arrive on the same channel as worker results (crate::app::terminal_input), so the
loop sleeps until either arrives or a deadline passes (Pacer). Keys typed
while busy are held in order and replayed one per iteration once idle, through
the path a fresh key takes; a replayed key’s follow-ups drain before the next is
offered, so a queued Enter finishes its search first.
Structs§
- Event
Pump - Owns the app, its channel and the keys held while it was busy.
- Pacer
- When the run loop draws and how long it may sleep: never on a fixed tick, only until the spinner’s next frame, an owed progress frame, or the app’s own deadline (a flash expiring).
Enums§
Constants§
- MAX_
HELD_ KEYS - Keys held while busy. Beyond this the newest is dropped and the user told: the
oldest may be the
/that makes the rest a query rather than hotkeys. - PROGRESS_
FRAME - The least time between frames drawn for progress reports alone; keys and results draw at once.
- SPINNER_
FRAME - How often a spinner turns while the user waits: about 30 frames a second.
- SPINNER_
IDLE_ FRAME - How often it turns for unwaited work (a count, a read-ahead): ten frames a second, redrawing a third as often.