about summary refs log tree commit diff
path: root/library/std
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-03-28 07:02:21 +0000
committerbors <bors@rust-lang.org>2023-03-28 07:02:21 +0000
commitf418859d8a464fb9ff5b5b1a4459d35fb8cfab1d (patch)
treeba5671b3f24a587b97680fab2e4f3156e6dc38a1 /library/std
parentcbc064b341be231403d181402a786cce7f1c73f1 (diff)
parenta69496002cd08d73fe1c901f2f179ca0a87fefb8 (diff)
downloadrust-f418859d8a464fb9ff5b5b1a4459d35fb8cfab1d.tar.gz
rust-f418859d8a464fb9ff5b5b1a4459d35fb8cfab1d.zip
Auto merge of #109690 - matthiaskrgr:rollup-6p5m0es, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #108548 (Clarify the 'use a constant in a pattern' error message)
 - #109565 (Improve documentation for E0223)
 - #109661 (Fix LVI test post LLVM 16 update)
 - #109667 (Always set `RUSTC_BOOTSTRAP` with `x doc`)
 - #109669 (Update books)
 - #109678 (Don't shadow the `dep_node` var in `incremental_verify_ich_failed`)
 - #109682 (Add `#[inline]` to CStr trait implementations)
 - #109685 (Make doc comment a little bit more accurate)
 - #109687 (Document the heuristics IsTerminal uses on Windows)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std')
-rw-r--r--library/std/src/io/stdio.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/library/std/src/io/stdio.rs b/library/std/src/io/stdio.rs
index 0455a00956e..1a3200a5c62 100644
--- a/library/std/src/io/stdio.rs
+++ b/library/std/src/io/stdio.rs
@@ -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;
 }