Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch atty to is-terminal #151

Merged
merged 1 commit into from Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Expand Up @@ -20,6 +20,7 @@ exclude = [
appveyor = { repository = "phsym/prettytable-rs", branch = "master", service = "github" }
travis-ci = { repository = "phsym/prettytable-rs", branch = "master" }
codecov = { repository = "phsym/prettytable-rs", branch = "master", service = "github" }
maintenance = { status = "passively-maintained" }

[features]
default = ["win_crlf", "csv"]
Expand All @@ -38,6 +39,6 @@ name = "prettytable"
unicode-width = "0.1"
term = "0.7"
lazy_static = "1"
atty = "0.2"
is-terminal = "0.4"
encode_unicode = "1"
csv = { version = "1", optional = true }
7 changes: 1 addition & 6 deletions README.md
Expand Up @@ -6,11 +6,6 @@
[![Doc.rs](https://docs.rs/prettytable-rs/badge.svg)](https://docs.rs/crate/prettytable-rs/)
[![Doc.rs](https://img.shields.io/badge/docs-master-blue.svg)](http://phsym.github.io/prettytable-rs/master)

> This crate has been abandonned without notice for quite a while due to some personnal reasons. My apologies for that.
I'll try to do my best to continue to maintain it, at least for security updates. If I can't the find time to do it, I'll have no other option than
deprecating it, or find new contributors to handover the maintenance to. Feel free to raise your hand if you're interrested.
In the meantime, please expect a low update rate, and again please accept my apologies.

# prettytable-rs

A formatted and aligned table printer library for [Rust](https://www.rust-lang.org).
Expand Down Expand Up @@ -45,7 +40,7 @@ Include the library as a dependency to your project by adding the following line
prettytable-rs = "^0.9"
```

The library requires at least `rust v1.32.0`.
The library requires at least `rust v1.41`.

## Basic usage

Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Expand Up @@ -193,7 +193,8 @@ impl<'a> TableSlice<'a> {
/// # Returns
/// A `Result` holding the number of lines printed, or an `io::Error` if any failure happens
pub fn print_tty(&self, force_colorize: bool) -> Result<usize, Error> {
match (stdout(), atty::is(atty::Stream::Stdout) || force_colorize) {
use is_terminal::IsTerminal;
match (stdout(), io::stdout().is_terminal() || force_colorize) {
(Some(mut o), true) => self.print_term(&mut *o),
_ => self.print(&mut io::stdout()),
}
Expand Down