beamtea_runtime (beamtea v0.1.2)
View SourceThe event loop that owns the terminal and drives an Elm program.
This process is the one that initialises prim_tty, so it must be registered (prim_tty derives its reader/writer process names from the owner's registered name). beamtea:start/3 takes care of that.
Lifecycle:
- put the tty in raw mode, enter the alternate screen, hide cursor
- run
init/1, render the first frame, arm the reader - loop: decode input into keys, feed messages to
update/2, run the returned commands, repaint - on quit/eof/crash: show cursor, leave the alternate screen and restore cooked mode — always, via
after
Summary
Functions
Run Prog to completion in the current (registered) process and return the final model. Called by beamtea:start/3.