Skip to content

Commit 1391039

Browse files
authored
Rollup merge of rust-lang#133711 - cod10129:master, r=Noratrieb
add isatty doc alias for `is_terminal` (first Rust contribution!) This adds `isatty` as a doc alias for [`std::io::IsTerminal::is_terminal`](https://doc.rust-lang.org/stable/std/io/trait.IsTerminal.html#tymethod.is_terminal). I think this change does meet the [doc alias policy](https://std-dev-guide.rust-lang.org/policy/doc-alias.html). This would be especially useful because searching "rust isatty" gets you the `isatty` crate which is deprecated in favor of `atty`. `atty` is unmaintained and you might get to `is-terminal`, which will finally tell you that the function you're looking for has been in `std` all along. The Windows implementation of `is_terminal()` doesn't use `isatty`, but that hasn't been a problem for the analogous cases of `create_dir()`'s alias `mkdir` or `remove_dir()`/`rmdir`.
2 parents fa2edee + 77b2fe1 commit 1391039

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/std/src/io/stdio.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1200,6 +1200,7 @@ pub trait IsTerminal: crate::sealed::Sealed {
12001200
///
12011201
/// [changes]: io#platform-specific-behavior
12021202
/// [`Stdin`]: crate::io::Stdin
1203+
#[doc(alias = "isatty")]
12031204
#[stable(feature = "is_terminal", since = "1.70.0")]
12041205
fn is_terminal(&self) -> bool;
12051206
}

0 commit comments

Comments
 (0)