# README
isatty
isatty for golang
Usage
package main
import (
"fmt"
"github.com/mysqto/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/mysqto/isatty
License
MIT
Author
Chen Lei (a.k.a mysqto) Yasuhiro Matsumoto (a.k.a mattn)
Thanks
-
k-takata: base idea for IsCygwinTerminal
-
oroginal
isatty
# Functions
IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 terminal.
IsTerminal return true if the file descriptor is terminal.