Clone this repo:
  1. c1975dc Merge pull request #35 from Helflym/master by mattn · 2 days ago master
  2. 463fe4a Add AIX support by Clément Chigot · 3 days ago
  3. c2a7a6c Merge pull request #33 from mattn/fix-android2 by mattn · 6 weeks ago v0.0.7
  4. 43386f2 Add missing method by Yasuhiro Matsumoto · 6 weeks ago
  5. 369ecd8 Merge pull request #30 from mattn/fix-android by mattn · 8 weeks ago v0.0.6

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