.github
Update Go test matrix to current versions (1.24-1.26)doc.go
godocexample_test.go
Move example to godocgo.mod
Lower go directive to 1.20 for Windows 7 users (#94)go.sum
Update dependencies: go 1.15 -> 1.21, golang.org/x/sys v0.6.0 -> v0.28.0go.test.sh
Enable codecovisatty_bsd.go
Adjust build tags to allow building on tinygo; for #73.isatty_others_test.go
tests: log value of IsTerminalisatty_others.go
add stub for haiku os (#93)isatty_plan9.go
add //go:buildisatty_solaris.go
add //go:buildisatty_tiocgwinsz.go
Use TIOCGWINSZ instead of TCGETS to detect terminals (#97)isatty_windows_test.go
Fix isCygwinPipeName to accept Windows 7 trailing suffix (#90)isatty_windows.go
Fix isCygwinPipeName to accept Windows 7 trailing suffix (#90)LICENSE
Added license file.README.md
Update README.mdgo-isatty
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-isattyLicense
MIT
Author
Yasuhiro Matsumoto (a.k.a mattn)
Thanks
-
k-takata: base idea for IsCygwinTerminal