Skip to content

Kwynto/isatty

Repository files navigation

isatty

isatty for golang

This is a fork of the project github.com/mattn/go-isatty by Yasuhiro Matsumoto (a.k.a mattn).

The fork was made to get rid of addiction and increase the reliability of my applications. Links to the author and the original repository have been saved.

Usage

package main

import (
	"fmt"
	"github.com/Kwynto/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/Kwynto/isatty

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)

Thanks

About

isatty for golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published