Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
.github/ | H | 29-Aug-2021 | - | |||
LICENSE | H A D | 29-Aug-2021 | 1.1 KiB | |||
README.md | H A D | 29-Aug-2021 | 1.1 KiB | |||
doc.go | H A D | 29-Aug-2021 | 64 | |||
example_test.go | H A D | 29-Aug-2021 | 306 | |||
go.mod | H A D | 29-Aug-2021 | 104 | |||
go.sum | H A D | 29-Aug-2021 | 207 | |||
go.test.sh | H A D | 29-Aug-2021 | 273 | |||
isatty_bsd.go | H A D | 29-Aug-2021 | 567 | |||
isatty_others.go | H A D | 29-Aug-2021 | 482 | |||
isatty_others_test.go | H A D | 29-Aug-2021 | 293 | |||
isatty_plan9.go | H A D | 29-Aug-2021 | 509 | |||
isatty_solaris.go | H A D | 29-Aug-2021 | 582 | |||
isatty_tcgets.go | H A D | 29-Aug-2021 | 507 | |||
isatty_windows.go | H A D | 29-Aug-2021 | 3.3 KiB | |||
isatty_windows_test.go | H A D | 29-Aug-2021 | 1 KiB |
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[![Codecov](https://codecov.io/gh/mattn/go-isatty/branch/master/graph/badge.svg)](https://codecov.io/gh/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