All Projects → softprops → Atty

softprops / Atty

Licence: mit
are you or are you not a tty?

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Atty

Rust Csv
A CSV parser for Rust, with Serde support.
Stars: ✭ 911 (+495.42%)
Mutual labels:  library, rust-library
Ta Rs
Technical analysis library for Rust language
Stars: ✭ 248 (+62.09%)
Mutual labels:  library, rust-library
Zui
⬢ Zsh User Interface library – CGI+DHTML-like rapid application development with Zsh
Stars: ✭ 95 (-37.91%)
Mutual labels:  tty, library
Finalcut
A text-based widget toolkit
Stars: ✭ 244 (+59.48%)
Mutual labels:  tty, library
Grammers
(tele)gramme.rs - use Telegram's API from Rust
Stars: ✭ 109 (-28.76%)
Mutual labels:  library, rust-library
Library Template Android
A Kotlin + Android library template (with a sample project).
Stars: ✭ 151 (-1.31%)
Mutual labels:  library
Deeply
PHP client for the DeepL.com translation API (unofficial)
Stars: ✭ 152 (-0.65%)
Mutual labels:  library
Jlibmodbus
JLibModbus is an implementation of the Modbus protocol v1.1b in java language.
Stars: ✭ 149 (-2.61%)
Mutual labels:  library
Pymo
A library for machine learning research on motion capture data
Stars: ✭ 150 (-1.96%)
Mutual labels:  library
Jails
An alternative for Javascript Vanilla Applications
Stars: ✭ 153 (+0%)
Mutual labels:  library
Python Quickui
Scientific One-Liner Interactive GUI Library
Stars: ✭ 153 (+0%)
Mutual labels:  library
Routeros Api Php
Mikrotik RouterOS API PHP client for your applications
Stars: ✭ 152 (-0.65%)
Mutual labels:  library
Mtpng
A parallelized PNG encoder in Rust
Stars: ✭ 151 (-1.31%)
Mutual labels:  rust-library
Aerogameframework
AeroGameFramework is a Roblox game framework that makes development easy and fun. The framework is designed to simplify the communication between modules and seamlessly bridge the gap between the server and client.
Stars: ✭ 150 (-1.96%)
Mutual labels:  library
Fos
Web Components to turn your web app into a fake operating system
Stars: ✭ 151 (-1.31%)
Mutual labels:  library
Garland View Android
≡ GarlandView seamlessly transitions between multiple lists of content. Made by @Ramotion
Stars: ✭ 1,855 (+1112.42%)
Mutual labels:  library
Envy
Envy automatically exposes environment variables for all of your Go flags
Stars: ✭ 150 (-1.96%)
Mutual labels:  library
Libcache
A Lightweight in-memory key:value cache library for Go.
Stars: ✭ 152 (-0.65%)
Mutual labels:  library
Php Ip Tools
Useful tools for IP manipulations
Stars: ✭ 152 (-0.65%)
Mutual labels:  library
Layerjs
layerJS: Javascript UI composition framework
Stars: ✭ 1,825 (+1092.81%)
Mutual labels:  library

atty

Build Status Build status Coverage Status crates.io Released API docs Master API docs

are you or are you not a tty?

install

Add the following to your Cargo.toml

[dependencies]
atty = "0.2"

usage

use atty::Stream;

fn main() {
  if atty::is(Stream::Stdout) {
    println!("I'm a terminal");
  } else {
    println!("I'm not");
  }
}

testing

This library has been unit tested on both unix and windows platforms (via appveyor).

A simple example program is provided in this repo to test various tty's. By default.

It prints

$ cargo run --example atty
stdout? true
stderr? true
stdin? true

To test std in, pipe some text to the program

$ echo "test" | cargo run --example atty
stdout? true
stderr? true
stdin? false

To test std out, pipe the program to something

$ cargo run --example atty | grep std
stdout? false
stderr? true
stdin? true

To test std err, pipe the program to something redirecting std err

$ cargo run --example atty 2>&1 | grep std
stdout? false
stderr? false
stdin? true

Doug Tangren (softprops) 2015-2019

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].