commit | bf9a1dea1961e1d831824fb135332bfb8c10e8b8 | [log] [tgz] |
---|---|---|
author | Chen Lei <my@mysq.to> | Sun Aug 18 12:36:53 2019 |
committer | mattn <mattn.jp@gmail.com> | Sun Aug 18 12:36:53 2019 |
tree | 833d1e3e8de47cbea0c5801a45e1b034ab9fe16d | |
parent | e1f7b56ace729e4a73a29a6b4fac6cd5fcda7ab3 [diff] |
add support for windows xp using NtQueryObject in ntdll.dll (#40) * add support for windows xp using NtQueryObject in ntdll.dll
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