commit | 504425e14f742f1f517c4586048b49b37f829c8e | [log] [tgz] |
---|---|---|
author | mattn <mattn.jp@gmail.com> | Sun Aug 29 14:41:14 2021 |
committer | GitHub <noreply@github.com> | Sun Aug 29 14:41:14 2021 |
tree | 3f58c30d908dc82e024fe3f85d53a74677a0a308 | |
parent | 68134e7c148cfd3c3697cec49e597a4089ea3281 [diff] | |
parent | ee4b64cd0185c49ed8fff5ade2c9923657fce6b7 [diff] |
Merge pull request #66 from cookieY/sys Update golang.org/x/sys commit hash to 0f9fa26a
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