Need help with go-isatty?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

mattn
484 Stars 65 Forks MIT License 105 Commits 6 Opened issues

Services available

!
?

Need anything else?

Contributors list

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

  • k-takata: base idea for IsCygwinTerminal

    https://github.com/k-takata/go-iscygpty

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.