Awesome Go

go-isatty

CategoryCommand Line
SubcategoryAdvanced Console UIs
Stars0

isatty for golang

About go-isatty

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

Frequently Asked Questions

What is go-isatty?

go-isatty is a Command Line library for the Go programming language. isatty for golang

How do I install go-isatty?

Install go-isatty with the Go module system using `go get mattn/go-isatty`. Check the repository for the current installation instructions.

What category does go-isatty belong to?

go-isatty is listed under Command Line, specifically Advanced Console UIs.

← Back to Advanced Console UIs