Skip to main content

euv_core/platform/terminal/
enum.rs

1/// Terminal host operating mode distinguishing interactive PTY TUI from static/pipe CLI execution.
2#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
3pub enum TerminalHostMode {
4    /// Automatically selects `InteractiveTui` when attached to a live TTY and `StaticCli` when piped.
5    #[default]
6    Auto,
7    /// Full-screen interactive PTY terminal UI with raw input, alternate screen, and resize handling.
8    InteractiveTui,
9    /// Non-interactive static/pipe CLI emitting clean stdout/stderr text and exit code without an event loop.
10    StaticCli,
11}
12
13/// Detected ANSI color depth supported by the attached terminal emulator.
14#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub enum TerminalColorCapability {
16    /// Monochrome / piped output with zero ANSI color escapes (`NO_COLOR` or non-TTY).
17    #[default]
18    None,
19    /// Standard 16-color ANSI SGR palette.
20    Ansi16,
21    /// Extended 256-color xterm SGR palette.
22    Ansi256,
23    /// Full 24-bit RGB truecolor (`38;2;r;g;b`).
24    TrueColor,
25}
26
27/// Target output stream used by static/pipe CLI host writes.
28#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
29pub enum TerminalStreamKind {
30    /// Standard program result stream (`stdout`).
31    #[default]
32    Stdout,
33    /// Diagnostics and error stream (`stderr`).
34    Stderr,
35}