about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2024-12-01 21:38:25 -0500
committerGitHub <noreply@github.com>2024-12-01 21:38:25 -0500
commit1391039fa763b517b04fa73df87bb9afdab7b1c3 (patch)
treed0561fc8d51882d949175baab7dc884fedadd700
parentfa2edee7587afb43bb2677bce544d3e380a082f5 (diff)
parent77b2fe19443ea44fabc3b4221b429165d4137804 (diff)
downloadrust-1391039fa763b517b04fa73df87bb9afdab7b1c3.tar.gz
rust-1391039fa763b517b04fa73df87bb9afdab7b1c3.zip
Rollup merge of #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`.
-rw-r--r--library/std/src/io/stdio.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/std/src/io/stdio.rs b/library/std/src/io/stdio.rs
index 35b38ed783f..318c3508221 100644
--- a/library/std/src/io/stdio.rs
+++ b/library/std/src/io/stdio.rs
@@ -1200,6 +1200,7 @@ pub trait IsTerminal: crate::sealed::Sealed {
     ///
     /// [changes]: io#platform-specific-behavior
     /// [`Stdin`]: crate::io::Stdin
+    #[doc(alias = "isatty")]
     #[stable(feature = "is_terminal", since = "1.70.0")]
     fn is_terminal(&self) -> bool;
 }