commit | a6dda38a851a575e6799957cdd53ffe0b3fdd90f | [log] [tgz] |
---|---|---|
author | mattn <mattn.jp@gmail.com> | Fri Feb 22 15:22:59 2019 |
committer | GitHub <noreply@github.com> | Fri Feb 22 15:22:59 2019 |
tree | fb37373aef6abb1301412ea3a989c5bf31555dd9 | |
parent | c6c56f60d87e35b1e5a3b3c643cd6fce2d58c8df [diff] | |
parent | 18d46088636edd220927b42cb0049a5255713b42 [diff] |
Merge pull request #28 from radeksimko/go-mod Enable go modules
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