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:
line—LineTerminal: plain cooked stdio (type a line, press Enter); no raw mode, works over pipes, dependency-free. The always-available default.rich—RichTerminal: a raw-mode terminal (behind theinteractivefeature) that reads individualKeys so widgets can offer arrow-key navigation with live-highlighted radio and checkbox lists.scripted—ScriptedTerminal: 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
Terminalfor tests and examples.
Structs§
- Capabilities
- What interaction model a
Terminalsupports.
Traits§
- Terminal
- The interactive medium a prompter reads from and renders to.