Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattn/go-isatty
https://github.com/mattn/go-isatty
cygwin go golang isatty msys2 website
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/mattn/go-isatty
- Owner: mattn
- License: mit
- Created: 2014-04-01T01:53:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-10-17T07:30:15.000Z (11 months ago)
- Last Synced: 2024-07-30T01:04:49.124Z (about 1 month ago)
- Topics: cygwin, go, golang, isatty, msys2, website
- Language: Go
- Homepage: http://godoc.org/github.com/mattn/go-isatty
- Size: 61.5 KB
- Stars: 818
- Watchers: 12
- Forks: 106
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-go - go-isatty - isatty for golang. (Command Line / Advanced Console UIs)
- awesome-ccamel - mattn/go-isatty - (Go)
- go-awesome - go-isatty - TTY environment assessment (Open source library / Command Line)
- awesome-go - go-isatty - isatty for golang. (Command Line / Advanced Console UIs)
- awesome-go - go-isatty - ★ 276 (Command Line)
- awesome-go-extra - go-isatty - 04-01T01:53:09Z|2022-08-15T05:52:43Z| (Build Automation / Advanced Console UIs)
README
# go-isatty
[![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty)
[![Codecov](https://codecov.io/gh/mattn/go-isatty/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-isatty)
[![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master)
[![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty)isatty for golang
## Usage
```go
package mainimport (
"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
* k-takata: base idea for IsCygwinTerminal
https://github.com/k-takata/go-iscygpty