Winlin 1545425e06 TEST: Upgrade pion to v3.2.9. (#3567) | 1 year ago | |
---|---|---|
.. | ||
.travis.yml | 2 years ago | |
LICENSE | 2 years ago | |
README.md | 2 years ago | |
doc.go | 2 years ago | |
isatty_android.go | 1 year ago | |
isatty_bsd.go | 1 year ago | |
isatty_others.go | 1 year ago | |
isatty_solaris.go | 1 year ago | |
isatty_tcgets.go | 1 year ago | |
isatty_windows.go | 1 year ago |
isatty for golang
package main
import (
"fmt"
"github.com/mattn/go-isatty"
"os"
)
func main() {
if isatty.IsTerminal(os.Stdout.Fd()) {
fmt.Println("Is Terminal")
} else if isatty.IsCygwinTerminal(os.Stdout.Fd()) {
fmt.Println("Is Cygwin/MSYS2 Terminal")
} else {
fmt.Println("Is Not Terminal")
}
}
$ go get github.com/mattn/go-isatty
MIT
Yasuhiro Matsumoto (a.k.a mattn)
k-takata: base idea for IsCygwinTerminal