gitlab.com/apertussolutions/u-root@v7.0.0+incompatible/cmds/core/elvish/sys/isatty_windows.go (about)

     1  // +build windows
     2  
     3  package sys
     4  
     5  import (
     6  	"os"
     7  
     8  	"github.com/mattn/go-isatty"
     9  )
    10  
    11  // IsATTY returns true if the given file descriptor is a terminal.
    12  func IsATTY(file *os.File) bool {
    13  	fd := uintptr(file.Fd())
    14  	return isatty.IsTerminal(fd) || isatty.IsCygwinTerminal(fd)
    15  }