nervネルフ

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.

plate 05lend, draw, hand back

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 saysmagi decides
a rolewhich palette index, from magi.ui
how many rows it wantshow many it gets, against the floor and the window
that it is finishedwhen 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.

The permission prompt is itself a surface. That is why it can show a wrapped command in full rather than a truncated one — and a command cut in the middle is a command somebody allows without having seen the end of.