You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

istty.go 217B

12345678910111213141516
  1. package pretty
  2. import (
  3. "os"
  4. "strings"
  5. "github.com/mattn/go-isatty"
  6. )
  7. var isTTY bool
  8. func init() {
  9. term := os.Getenv("TERM")
  10. isTTY = strings.HasPrefix(term, "xterm") ||
  11. isatty.IsTerminal(os.Stdout.Fd())
  12. }