Clone this repo:
  1. 3751eb4 Merge pull request #58 from mahdi-hm/master by mattn · 3 months ago master
  2. 360bbd2 Fix lack of zOS support #57 by Mahdi Hosseini · 5 months ago
  3. cb30d62 Delete renovate.json by mattn · 1 year, 3 months ago
  4. 28b35a3 Merge pull request #51 from martinlindhe/master by mattn · 1 year, 3 months ago
  5. dc81b0f add wasm target to others by Martin Lindhe · 1 year, 3 months ago

go-isatty

Godoc Reference Codecov 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