Skip to main content

Crate sim_view_tty

Crate sim_view_tty 

Source
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:

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 cli surface capabilities with client_id set.
intent_from_key
Reduces a key event to a validated Intent for pane/target at tick.
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 scene to deterministic terminal text for the surface caps.
tui_caps
Builds the tui surface capabilities with client_id set.