Closed
Description
Feature gate: #![feature(is_terminal)]
This is a tracking issue for the IsTerminal
trait and its is_terminal
method, to determine if a descriptor/handle refers to a terminal.
Public API
// std::io
pub trait IsTerminal {
fn is_terminal(&self) -> bool;
}
impl IsTerminal for Stdin { /* ... */ }
impl IsTerminal for StdinLock<'_> { /* ... */ }
impl IsTerminal for Stdout { /* ... */ }
impl IsTerminal for StdoutLock<'_> { /* ... */ }
impl IsTerminal for Stderr { /* ... */ }
impl IsTerminal for StderrLock<'_> { /* ... */ }
impl IsTerminal for File { /* ... */ }
#[cfg(unix)]
impl IsTerminal for BorrowedFd { /* ... */ }
#[cfg(unix)]
impl IsTerminal for OwnedFd { /* ... */ }
#[cfg(windows)]
impl IsTerminal for BorrowedHandle { /* ... */ }
#[cfg(windows)]
impl IsTerminal for OwnedHandle { /* ... */ }
Steps / History
- Implementation: Add
IsTerminal
trait to determine if a descriptor or handle is a terminal #98033 - Final comment period (FCP)
- Stabilization PR