Rollup merge of #109687 - joshtriplett:document-windows-isterminal-heuristics, r=BurntSushi
Document the heuristics IsTerminal uses on Windows Suggested by `@BurntSushi.`
This commit is contained in:
commit
a69496002c
@ -1054,6 +1054,15 @@ pub trait IsTerminal: crate::sealed::Sealed {
|
||||
/// On platforms where Rust does not know how to detect a terminal yet, this will return
|
||||
/// `false`. This will also return `false` if an unexpected error occurred, such as from
|
||||
/// passing an invalid file descriptor.
|
||||
///
|
||||
/// # Platform-specific behavior
|
||||
///
|
||||
/// On Windows, in addition to detecting consoles, this currently uses some heuristics to
|
||||
/// detect older msys/cygwin/mingw pseudo-terminals based on device name: devices with names
|
||||
/// starting with `msys-` or `cygwin-` and ending in `-pty` will be considered terminals.
|
||||
/// Note that this [may change in the future][changes].
|
||||
///
|
||||
/// [changes]: io#platform-specific-behavior
|
||||
fn is_terminal(&self) -> bool;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user