status-go/vendor/github.com/mattn/go-isatty
richΛrd 9e0fb30f8d
chore_: bump go-waku (#5150)
2024-05-15 19:15:00 -04:00
..
LICENSE Introduce the dependency vendoring tool: `dep`. (#551) 2018-01-25 14:08:43 +01:00
README.md chore: bump go-waku (#2404) 2021-10-19 09:43:41 -04:00
doc.go Introduce the dependency vendoring tool: `dep`. (#551) 2018-01-25 14:08:43 +01:00
go.test.sh chore: bump go-waku (#2404) 2021-10-19 09:43:41 -04:00
isatty_bsd.go chore_: bump go-waku (#5150) 2024-05-15 19:15:00 -04:00
isatty_others.go chore_: bump go-waku (#5150) 2024-05-15 19:15:00 -04:00
isatty_plan9.go chore: bump go-waku 2022-04-06 10:36:06 -04:00
isatty_solaris.go chore: bump go-waku 2022-04-06 10:36:06 -04:00
isatty_tcgets.go chore_: bump go-waku (#5150) 2024-05-15 19:15:00 -04:00
isatty_windows.go chore: bump go-waku 2022-04-06 10:36:06 -04:00

README.md

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