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 IsTerminal with convenient methods for checking TTY capabilities with consistent NO_COLOR / FORCE_COLOR handling.

Required Methods§

Source

fn is_tty_ext(&self) -> bool

Returns true if this stream is connected to a terminal.

Source

fn supports_color(&self) -> bool

Returns true if this stream supports ANSI color codes.

This checks both TTY status and the NO_COLOR / FORCE_COLOR environment variables.

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§