The screen, lent out
Most tools print and exit. Some need the screen — a pager, an editor, a picker, a permission prompt. Such a tool asks for rows and then owns them.
A tool never names a colour
A surface draws in roles — this is a heading, this is selected, this is an error — and magi resolves each role against the palette the person configured.
| the tool says | magi decides |
|---|---|
| a role | which palette index, from magi.ui |
| how many rows it wants | how many it gets, against the floor and the window |
| that it is finished | when the rows are reclaimed and repainted |
A tool that named a colour would look wrong on somebody else's terminal, and the person's own settings would stop applying the moment a tool drew anything.
How it ends
When the tool says so, or when the person presses escape twice. Then magi repaints around it and the rows go back.
Why frames and not one exec
A surface is a stream of frames both ways for as long as the tool holds its rows — keys and clicks down, a drawn frame back. One exec per event would restart the program between keystrokes, which is not an editor.