Skip to content

Commit 1d5ebd6

Browse files
committed
Rename to rustix-is-terminal.
This renames from is-terminal to rustix-is-terminal, and prepares for rustix support to live in a separate crate.
1 parent 6c8aff6 commit 1d5ebd6

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

Cargo.toml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[package]
2-
name = "is-terminal"
2+
name = "rustix-is-terminal"
33
version = "0.4.9"
44
authors = [
55
"softprops <[email protected]>",
66
"Dan Gohman <[email protected]>"
77
]
8-
description = "Test whether a given stream is a terminal"
9-
documentation = "https://docs.rs/is-terminal"
10-
repository = "https://github.com/sunfishcode/is-terminal"
8+
description = "Test whether a given stream is a terminal, using rustix"
9+
documentation = "https://docs.rs/rustix-is-terminal"
10+
repository = "https://github.com/sunfishcode/rustix-is-terminal"
1111
keywords = ["terminal", "tty", "isatty"]
1212
categories = ["command-line-interface"]
1313
license = "MIT"
14-
edition = "2018"
14+
edition = "2021"
1515
include = ["src", "build.rs", "Cargo.toml", "COPYRIGHT", "LICENSE*", "/*.md"]
1616
rust-version = "1.63"
1717

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

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

4141
[target.'cfg(windows)'.dev-dependencies]
4242
tempfile = "3"
43+
44+
[features]
45+
default = ["std"]
46+
std = ["rustix/std"]

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
<div align="center">
2-
<h1><code>is-terminal</code></h1>
2+
<h1><code>rustix-is-terminal</code></h1>
33

44
<p>
5-
<strong>Test whether a given stream is a terminal</strong>
5+
<strong>Test whether a given stream is a terminal, using rustix</strong>
66
</p>
77

88
<p>
9-
<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>
10-
<a href="https://crates.io/crates/is-terminal"><img src="https://img.shields.io/crates/v/is-terminal.svg" alt="crates.io page" /></a>
11-
<a href="https://docs.rs/is-terminal"><img src="https://docs.rs/is-terminal/badge.svg" alt="docs.rs docs" /></a>
9+
<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>
10+
<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>
11+
<a href="https://docs.rs/rustix-is-terminal"><img src="https://docs.rs/rustix-is-terminal/badge.svg" alt="docs.rs docs" /></a>
1212
</p>
1313
</div>
1414

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

18+
This crate is similar to the [is-terminal] crate, but uses `rustix` instead
19+
of `libc` in its implementation. This allows it to support `no_std` on
20+
`unix`-family platforms.
21+
22+
[is-terminal]: https://crates.io/crates/is-terminal/
23+
1824
<hr>
1925

2026
is-terminal is a simple utility that answers one question:

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! is-terminal is a simple utility that answers one question:
1+
//! rustix-is-terminal is a simple utility that answers one question:
22
//!
33
//! > Is this a terminal?
44
//!
@@ -16,7 +16,7 @@
1616
//! # Example
1717
//!
1818
//! ```rust
19-
//! use is_terminal::IsTerminal;
19+
//! use rustix_is_terminal::IsTerminal;
2020
//!
2121
//! if std::io::stdout().is_terminal() {
2222
//! println!("stdout is a terminal")

0 commit comments

Comments
 (0)