pub trait TtyExt {
// Required methods
fn is_tty_ext(&self) -> bool;
fn supports_color(&self) -> bool;
fn is_interactive(&self) -> bool;
}Expand description
Extension trait for TTY detection on standard I/O streams.
This trait extends crossterm’s IsTty to provide convenient methods
for checking TTY capabilities with better error handling.
Required Methods§
Sourcefn is_tty_ext(&self) -> bool
fn is_tty_ext(&self) -> bool
Returns true if this stream is connected to a terminal.
This is a convenience wrapper around crossterm’s IsTty trait
that provides consistent behavior across the codebase.
Sourcefn supports_color(&self) -> bool
fn supports_color(&self) -> bool
Returns true if this stream supports ANSI color codes.
This checks both TTY status and common environment variables that might disable color output.
Sourcefn is_interactive(&self) -> bool
fn is_interactive(&self) -> bool
Returns true if this stream supports interactive features.
Interactive features include cursor movement, color, and other terminal capabilities that require a real terminal.