• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H21-Jan-2020-

.travis.ymlH A D21-Jan-2020174

LICENSEH A D21-Jan-20201.1 KiB

README.mdH A D21-Jan-20201.1 KiB

doc.goH A D21-Jan-202064

example_test.goH A D21-Jan-2020306

go.modH A D21-Jan-2020104

go.sumH A D21-Jan-2020207

go.test.shH A D21-Jan-2020273

isatty_bsd.goH A D21-Jan-2020488

isatty_others.goH A D21-Jan-2020434

isatty_others_test.goH A D21-Jan-2020273

isatty_plan9.goH A D21-Jan-2020492

isatty_solaris.goH A D21-Jan-2020596

isatty_tcgets.goH A D21-Jan-2020456

isatty_windows.goH A D21-Jan-20203.3 KiB

isatty_windows_test.goH A D21-Jan-20201 KiB

renovate.jsonH A D21-Jan-202087

README.md

1# go-isatty
2
3[![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty)
4[![Codecov](https://codecov.io/gh/mattn/go-isatty/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-isatty)
5[![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master)
6[![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty)
7
8isatty for golang
9
10## Usage
11
12```go
13package main
14
15import (
16	"fmt"
17	"github.com/mattn/go-isatty"
18	"os"
19)
20
21func main() {
22	if isatty.IsTerminal(os.Stdout.Fd()) {
23		fmt.Println("Is Terminal")
24	} else if isatty.IsCygwinTerminal(os.Stdout.Fd()) {
25		fmt.Println("Is Cygwin/MSYS2 Terminal")
26	} else {
27		fmt.Println("Is Not Terminal")
28	}
29}
30```
31
32## Installation
33
34```
35$ go get github.com/mattn/go-isatty
36```
37
38## License
39
40MIT
41
42## Author
43
44Yasuhiro Matsumoto (a.k.a mattn)
45
46## Thanks
47
48* k-takata: base idea for IsCygwinTerminal
49
50    https://github.com/k-takata/go-iscygpty
51