diff options
| author | Josh Triplett <josh@joshtriplett.org> | 2023-03-28 10:49:35 +0900 |
|---|---|---|
| committer | Josh Triplett <josh@joshtriplett.org> | 2023-03-28 10:49:35 +0900 |
| commit | 1354a38afd7c7183e4e7f5f17bef7fccfc4d2a06 (patch) | |
| tree | 4170ff7e9fe692ad20102eb6e93539053b3bb6ee /library/std/src/io/stdio.rs | |
| parent | 5bf139e3609255f6bdeae0f8dcc40eeb1021148b (diff) | |
| download | rust-1354a38afd7c7183e4e7f5f17bef7fccfc4d2a06.tar.gz rust-1354a38afd7c7183e4e7f5f17bef7fccfc4d2a06.zip | |
Document the heuristics IsTerminal uses on Windows
Diffstat (limited to 'library/std/src/io/stdio.rs')
| -rw-r--r-- | library/std/src/io/stdio.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/io/stdio.rs b/library/std/src/io/stdio.rs index 0455a00956e..7c1bf488a21 100644 --- a/library/std/src/io/stdio.rs +++ b/library/std/src/io/stdio.rs @@ -1054,6 +1054,10 @@ 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. + /// + /// 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. fn is_terminal(&self) -> bool; } |
