Skip to content

Commit

Permalink
Rename to rustix-is-terminal.
Browse files Browse the repository at this point in the history
This renames from is-terminal to rustix-is-terminal, and prepares for
rustix support to live in a separate crate.
  • Loading branch information
sunfishcode committed Dec 28, 2023
1 parent 6c8aff6 commit 1d5ebd6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
16 changes: 10 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[package]
name = "is-terminal"
name = "rustix-is-terminal"
version = "0.4.9"
authors = [
"softprops <[email protected]>",
"Dan Gohman <[email protected]>"
]
description = "Test whether a given stream is a terminal"
documentation = "https://docs.rs/is-terminal"
repository = "https://github.com/sunfishcode/is-terminal"
description = "Test whether a given stream is a terminal, using rustix"
documentation = "https://docs.rs/rustix-is-terminal"
repository = "https://github.com/sunfishcode/rustix-is-terminal"
keywords = ["terminal", "tty", "isatty"]
categories = ["command-line-interface"]
license = "MIT"
edition = "2018"
edition = "2021"
include = ["src", "build.rs", "Cargo.toml", "COPYRIGHT", "LICENSE*", "/*.md"]
rust-version = "1.63"

[target.'cfg(not(any(windows, target_os = "hermit", target_os = "unknown")))'.dependencies]
rustix = { version = "0.38.0", features = ["termios"] }
rustix = { version = "0.38.0", default-features = false, features = ["termios"] }

[target.'cfg(target_os = "hermit")'.dependencies]
hermit-abi = "0.3.0"
Expand All @@ -40,3 +40,7 @@ rustix = { version = "0.38.0", features = ["stdio"] }

[target.'cfg(windows)'.dev-dependencies]
tempfile = "3"

[features]
default = ["std"]
std = ["rustix/std"]
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
<div align="center">
<h1><code>is-terminal</code></h1>
<h1><code>rustix-is-terminal</code></h1>

<p>
<strong>Test whether a given stream is a terminal</strong>
<strong>Test whether a given stream is a terminal, using rustix</strong>
</p>

<p>
<a href="https://github.com/sunfishcode/is-terminal/actions?query=workflow%3ACI"><img src="https://github.com/sunfishcode/is-terminal/workflows/CI/badge.svg" alt="Github Actions CI Status" /></a>
<a href="https://crates.io/crates/is-terminal"><img src="https://img.shields.io/crates/v/is-terminal.svg" alt="crates.io page" /></a>
<a href="https://docs.rs/is-terminal"><img src="https://docs.rs/is-terminal/badge.svg" alt="docs.rs docs" /></a>
<a href="https://github.com/sunfishcode/rustix-is-terminal/actions?query=workflow%3ACI"><img src="https://github.com/sunfishcode/rustix-is-terminal/workflows/CI/badge.svg" alt="Github Actions CI Status" /></a>
<a href="https://crates.io/crates/rustix-is-terminal"><img src="https://img.shields.io/crates/v/rustix-is-terminal.svg" alt="crates.io page" /></a>
<a href="https://docs.rs/rustix-is-terminal"><img src="https://docs.rs/rustix-is-terminal/badge.svg" alt="docs.rs docs" /></a>
</p>
</div>

As of Rust 1.70, most users should use the [`IsTerminal`] trait in the Rust
standard library instead of this crate.

This crate is similar to the [is-terminal] crate, but uses `rustix` instead
of `libc` in its implementation. This allows it to support `no_std` on
`unix`-family platforms.

[is-terminal]: https://crates.io/crates/is-terminal/

<hr>

is-terminal is a simple utility that answers one question:
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! is-terminal is a simple utility that answers one question:
//! rustix-is-terminal is a simple utility that answers one question:
//!
//! > Is this a terminal?
//!
Expand All @@ -16,7 +16,7 @@
//! # Example
//!
//! ```rust
//! use is_terminal::IsTerminal;
//! use rustix_is_terminal::IsTerminal;
//!
//! if std::io::stdout().is_terminal() {
//! println!("stdout is a terminal")
Expand Down

0 comments on commit 1d5ebd6

Please sign in to comment.