Skip to main content

TtyExt

Trait TtyExt 

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

Source

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.

Source

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.

Source

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TtyExt for Stderr

Source§

impl TtyExt for Stdin

Source§

impl TtyExt for Stdout

Implementors§