Expand description
Crossterm event stream → Msg.
One of two branches in the main loop’s central select!.
Crossterm’s EventStream yields key presses, mouse events,
pastes, and resize notifications; we translate each into the
typed Msg vocabulary the reducer understands.
The event source knows nothing about state. The reducer owns the transitions; the event source just produces typed inputs.
For --replay, a second event source (in recorder.rs) reads
previously-recorded JSONL and yields the same Msg stream. The
main loop can’t tell live crossterm events apart from replayed
ones — that’s the point.
Functions§
- coalesce_
key_ burst - Coalesce a burst of character/Enter key presses into a single paste.
- event_
to_ msg - Translate one crossterm event into
Msg. ReturnsNonefor events the reducer doesn’t care about (focus gained/lost, unknown media keys, key repeats, etc.). - parse_
slash_ command - Parse a slash-command input line (without the leading
/) into aSlashCmd. ReturnsSlashCmd::Unknownif the command isn’t in the registry. Shared between the TUI dispatcher (C8) and any non-interactive command dispatch.