add support for windows xp using NtQueryObject in ntdll.dll (#40)

* add support for windows xp using NtQueryObject in ntdll.dll
2 files changed
tree: 833d1e3e8de47cbea0c5801a45e1b034ab9fe16d
  1. .github/
  2. .travis.yml
  3. doc.go
  4. example_test.go
  5. go.mod
  6. go.sum
  7. isatty_android.go
  8. isatty_bsd.go
  9. isatty_others.go
  10. isatty_others_test.go
  11. isatty_solaris.go
  12. isatty_tcgets.go
  13. isatty_windows.go
  14. isatty_windows_test.go
  15. LICENSE
  16. README.md
README.md

go-isatty

Godoc Reference Build Status Coverage Status Go Report Card

isatty for golang

Usage

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")
	}
}

Installation

$ go get github.com/mattn/go-isatty

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)

Thanks