commit | 57fdcb988a5c543893cc61bce354a6e24ab70022 | [log] [tgz] |
---|---|---|
author | mattn <mattn.jp@gmail.com> | Tue Mar 07 16:30:44 2017 |
committer | GitHub <noreply@github.com> | Tue Mar 07 16:30:44 2017 |
tree | 87918ab62aa58f6da72f9f143d114507f909954f | |
parent | 9622e0cc9d8f9be434ca605520ff9a16808fee47 [diff] | |
parent | 2c84d1a24228fa4786c0c3d19a507e8cb0fb91d7 [diff] |
Merge pull request #16 from lgonzalez-silen/master Add isCygwinTerminal to non-appengine environments
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