Add IsCygwinTerminal to check cygwin/msys2 terminal

Thanks to @k-takata

Close #8
3 files changed
tree: 9c9f4656c25a4333fe5c52f438b6cdd3045513a7
  1. _example/
  2. doc.go
  3. isatty_appengine.go
  4. isatty_bsd.go
  5. isatty_linux.go
  6. isatty_not_windows.go
  7. isatty_solaris.go
  8. isatty_windows.go
  9. LICENSE
  10. README.md
README.md

go-isatty

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 {
		fmt.Println("Is Not Terminal")
	}
}

Installation

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

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)