{"id":13477716,"url":"https://github.com/softprops/atty","last_synced_at":"2025-05-15T07:04:46.486Z","repository":{"id":34559808,"uuid":"38505249","full_name":"softprops/atty","owner":"softprops","description":"are you or are you not a tty?","archived":false,"fork":false,"pushed_at":"2024-07-18T16:22:13.000Z","size":814,"stargazers_count":279,"open_issues_count":23,"forks_count":51,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-08T00:05:50.369Z","etag":null,"topics":["library","rust","rust-library","tty"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/softprops.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"softprops"}},"created_at":"2015-07-03T18:13:49.000Z","updated_at":"2025-05-02T00:26:12.000Z","dependencies_parsed_at":"2024-01-16T22:18:44.408Z","dependency_job_id":"f712a369-5c9d-43dc-a411-a65a0bf5a50f","html_url":"https://github.com/softprops/atty","commit_stats":{"total_commits":113,"total_committers":13,"mean_commits":8.692307692307692,"dds":0.1415929203539823,"last_synced_commit":"5bfdbe9e48c6ca6a4909e8d5b04f5e843a257e93"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softprops%2Fatty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softprops%2Fatty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softprops%2Fatty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softprops%2Fatty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softprops","download_url":"https://codeload.github.com/softprops/atty/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166520,"owners_count":21864482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library","rust","rust-library","tty"],"created_at":"2024-07-31T16:01:46.566Z","updated_at":"2025-05-15T07:04:46.393Z","avatar_url":"https://github.com/softprops.png","language":"Rust","funding_links":["https://ko-fi.com/softprops"],"categories":["Rust"],"sub_categories":[],"readme":"# atty\n\n\u003e [!WARNING]\n\u003e This is crate is no longer maintained and users are encouraged to prefer\n\u003e the equivalant functionality of [std.io.IsTerminal](https://doc.rust-lang.org/std/io/trait.IsTerminal.html), introduced in [Rust 1.70.0](https://blog.rust-lang.org/2023/06/01/Rust-1.70.0.html#isterminal)\n\u003e\n\u003e Thank you for your support!\n\n[![Build Status](https://travis-ci.org/softprops/atty.svg?branch=master)](https://travis-ci.org/softprops/atty) [![Build status](https://ci.appveyor.com/api/projects/status/geggrsnsjsuse8cv?svg=true)](https://ci.appveyor.com/project/softprops/atty) [![Coverage Status](https://coveralls.io/repos/softprops/atty/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/softprops/atty?branch=master) [![crates.io](https://img.shields.io/crates/v/atty.svg)](https://crates.io/crates/atty) [![Released API docs](https://docs.rs/atty/badge.svg)](http://docs.rs/atty) [![Master API docs](https://img.shields.io/badge/docs-master-green.svg)](https://softprops.github.io/atty)\n\n\u003e are you or are you not a tty?\n\n## install\n\nAdd the following to your `Cargo.toml`\n\n```toml\n[dependencies]\natty = \"0.2\"\n```\n\n## usage\n\n```rust\nuse atty::Stream;\n\nfn main() {\n  if atty::is(Stream::Stdout) {\n    println!(\"I'm a terminal\");\n  } else {\n    println!(\"I'm not\");\n  }\n}\n```\n\n## testing\n\nThis library has been unit tested on both unix and windows platforms (via appveyor).\n\nA simple example program is provided in this repo to test various tty's. By default.\n\nIt prints\n\n```bash\n$ cargo run --example atty\nstdout? true\nstderr? true\nstdin? true\n```\n\nTo test std in, pipe some text to the program\n\n```bash\n$ echo \"test\" | cargo run --example atty\nstdout? true\nstderr? true\nstdin? false\n```\n\nTo test std out, pipe the program to something\n\n```bash\n$ cargo run --example atty | grep std\nstdout? false\nstderr? true\nstdin? true\n```\n\nTo test std err, pipe the program to something redirecting std err\n\n```bash\n$ cargo run --example atty 2\u003e\u00261 | grep std\nstdout? false\nstderr? false\nstdin? true\n```\n\nDoug Tangren (softprops) 2015-2019\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftprops%2Fatty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftprops%2Fatty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftprops%2Fatty/lists"}