sumi

Beyond · The terminal

Inline mode

By default a sumi app takes over the whole screen using the terminal’s alternate buffer, like a full-screen TUI. Inline mode is the other model: instead of clearing the screen, sumi draws a live region at the shell cursor that grows and shrinks in place, and leaves its final frame behind in the scrollback when the app exits. It reads as ordinary command output — the model behind installers, progress bars, prompts, and REPL-style tools.

Inline mode is a field on RunOptions, so it is chosen in your main, not in the component:

tui.RunWithOptions(comp, tui.RunOptions{
    Inline: true,
})

On exit the last frame is not erased; it stays in the session history like the output of any other command. The other options — input, output, mouse, colour scheme — work the same in both modes.

This runner always uses the full-screen path, so you cannot see inline behaviour here; the progress display below renders in the alternate screen instead. To try it for real, scaffold an app with sumi init and set Inline: true in its main. There is no Solve for this lesson.

Your turn

Press Run to see the component. Then picture it drawn inline at your shell prompt: updating in place as a download proceeds, then leaving its final line behind in your scrollback.

⌘↵ to run