Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
.travis.yml | H A D | 07-Nov-2017 | 227 | |||
LICENSE | H A D | 07-Nov-2017 | 1.1 KiB | |||
README.md | H A D | 07-Nov-2017 | 1.1 KiB | |||
doc.go | H A D | 07-Nov-2017 | 64 | |||
example_test.go | H A D | 07-Nov-2017 | 306 | |||
isatty_appengine.go | H A D | 07-Nov-2017 | 422 | |||
isatty_bsd.go | H A D | 07-Nov-2017 | 425 | |||
isatty_linux.go | H A D | 07-Nov-2017 | 405 | |||
isatty_linux_ppc64x.go | H A D | 07-Nov-2017 | 415 | |||
isatty_others.go | H A D | 07-Nov-2017 | 250 | |||
isatty_others_test.go | H A D | 07-Nov-2017 | 273 | |||
isatty_solaris.go | H A D | 07-Nov-2017 | 402 | |||
isatty_windows.go | H A D | 07-Nov-2017 | 2.1 KiB | |||
isatty_windows_test.go | H A D | 07-Nov-2017 | 831 |
README.md
1# go-isatty 2 3[![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty) 4[![Build Status](https://travis-ci.org/mattn/go-isatty.svg?branch=master)](https://travis-ci.org/mattn/go-isatty) 5[![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) 6[![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty) 7 8isatty for golang 9 10## Usage 11 12```go 13package main 14 15import ( 16 "fmt" 17 "github.com/mattn/go-isatty" 18 "os" 19) 20 21func main() { 22 if isatty.IsTerminal(os.Stdout.Fd()) { 23 fmt.Println("Is Terminal") 24 } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { 25 fmt.Println("Is Cygwin/MSYS2 Terminal") 26 } else { 27 fmt.Println("Is Not Terminal") 28 } 29} 30``` 31 32## Installation 33 34``` 35$ go get github.com/mattn/go-isatty 36``` 37 38## License 39 40MIT 41 42## Author 43 44Yasuhiro Matsumoto (a.k.a mattn) 45 46## Thanks 47 48* k-takata: base idea for IsCygwinTerminal 49 50 https://github.com/k-takata/go-iscygpty 51