Skip to main content

Module terminal

Module terminal 

Source
Expand description

The interactive medium a Prompter speaks through.

A Terminal abstracts how a prompt reads input and renders — decoupled from what a prompt asks — so one set of prompt-kind logic drives three very different realities:

  • lineLineTerminal: plain cooked stdio (type a line, press Enter); no raw mode, works over pipes, dependency-free. The always-available default.
  • richRichTerminal: a raw-mode terminal (behind the interactive feature) that reads individual Keys so widgets can offer arrow-key navigation with live-highlighted radio and checkbox lists.
  • scriptedScriptedTerminal: a deterministic test double that feeds canned keys or lines and captures rendered output, so both the key-driven and line-driven paths are unit-testable without a real terminal.

A terminal advertises whether it is key-driven via Capabilities; prompt kinds branch on that once and never touch a concrete terminal type.

Re-exports§

pub use line::LineTerminal;
pub use scripted::ScriptedTerminal;
pub use rich::RichTerminal;

Modules§

line
Plain cooked-stdio terminal: the dependency-free, always-available default.
rich
A raw-mode terminal over crossterm, enabling live arrow-key navigation.
scripted
A deterministic in-memory Terminal for tests and examples.

Structs§

Capabilities
What interaction model a Terminal supports.

Traits§

Terminal
The interactive medium a prompter reads from and renders to.