mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 09:57:51 +08:00
16 lines
271 B
Go
16 lines
271 B
Go
// +build windows
|
|
|
|
package sys
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/mattn/go-isatty"
|
|
)
|
|
|
|
// IsATTY returns true if the given file descriptor is a terminal.
|
|
func IsATTY(file *os.File) bool {
|
|
fd := uintptr(file.Fd())
|
|
return isatty.IsTerminal(fd) || isatty.IsCygwinTerminal(fd)
|
|
}
|