SVI f5825b7a0e Добавление вендоринга | 1 year ago | |
---|---|---|
.. | ||
LICENSE | 1 year ago | |
README.md | 1 year ago | |
doc.go | 1 year ago | |
go.test.sh | 1 year ago | |
isatty_bsd.go | 1 year ago | |
isatty_others.go | 1 year ago | |
isatty_plan9.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