delve/vendor/github.com/mattn/go-isatty
Yasuhiro Matsumoto f6836cbcf1 terminal: Use go-colorable
Add fallback to display colors on Windows.
2016-04-18 12:49:14 -07:00
..
doc.go terminal: Use go-colorable 2016-04-18 12:49:14 -07:00
isatty_appengine.go terminal: Use go-colorable 2016-04-18 12:49:14 -07:00
isatty_bsd.go terminal: Use go-colorable 2016-04-18 12:49:14 -07:00
isatty_linux.go terminal: Use go-colorable 2016-04-18 12:49:14 -07:00
isatty_solaris.go terminal: Use go-colorable 2016-04-18 12:49:14 -07:00
isatty_windows.go terminal: Use go-colorable 2016-04-18 12:49:14 -07:00
LICENSE terminal: Use go-colorable 2016-04-18 12:49:14 -07:00
README.md terminal: Use go-colorable 2016-04-18 12:49:14 -07:00

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)