commit | 62f712808a2a54a0f220e557074b33f99af9440b | [log] [tgz] |
---|---|---|
author | Drew DeVault <sir@cmpwn.com> | Thu Oct 03 00:19:46 2019 |
committer | mattn <mattn.jp@gmail.com> | Thu Oct 03 00:19:46 2019 |
tree | ca4b0466d7d6a106d938438f02c0c053e5f88791 | |
parent | bf9a1dea1961e1d831824fb135332bfb8c10e8b8 [diff] |
isatty_plan9.go: initial commit (#42) Based on the best-guess behavior of ape's isatty for Plan 9.
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