Expand description
Loadable terminal (CLI/TUI) view/edit surface for SIM.
The thesis: a terminal is one surface, not a baked subcommand. The sim
binary stays a bootloader; this crate is a library loaded at runtime that
projects a Scene to text and reduces terminal key input to
Intent values. Nothing here parses argv or owns the
process. Both directions are pure and deterministic, so the whole surface is
testable without a tty:
render_scenefits a scene to aSurfaceCaps(via the view crate’s density projection) and walks it to stable ASCII.intent_from_keyturns a normalizedKeyInputinto a validated Intent.
The CLI and TUI presets differ only in advertised capabilities – a cli
surface is keyboard-only ANSI, a tui surface adds pointer input and a
richer palette – which the projection ranker reads. Build them with
cli_caps and tui_caps.
§Example
use sim_view_tty::{cli_caps, render_scene};
let scene = sim_lib_scene::build::text_node("ready");
let text = render_scene(&scene, &cli_caps("tty.local.1"));
assert_eq!(text, "ready");Enums§
- KeyInput
- A normalized terminal key event, decoded from raw input upstream.
Functions§
- cli_
caps - Builds the
clisurface capabilities withclient_idset. - intent_
from_ key - Reduces a key event to a validated Intent for
pane/targetattick. - palette_
intent_ from_ colon - Drives the shared command palette from a
:-prompt entry. - render_
palette - Renders the shared command palette overlay to deterministic terminal text.
- render_
scene - Renders
sceneto deterministic terminal text for the surfacecaps. - tui_
caps - Builds the
tuisurface capabilities withclient_idset.