source: code/trunk/vendor/github.com/mattn/go-isatty/isatty_bsd.go@ 822

Last change on this file since 822 was 822, checked in by yakumo.izuru, 22 months ago

Prefer immortal.run over runit and rc.d, use vendored modules
for convenience.

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

File size: 567 bytes
Line 
1//go:build (darwin || freebsd || openbsd || netbsd || dragonfly) && !appengine
2// +build darwin freebsd openbsd netbsd dragonfly
3// +build !appengine
4
5package isatty
6
7import "golang.org/x/sys/unix"
8
9// IsTerminal return true if the file descriptor is terminal.
10func IsTerminal(fd uintptr) bool {
11 _, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA)
12 return err == nil
13}
14
15// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
16// terminal. This is also always false on this environment.
17func IsCygwinTerminal(fd uintptr) bool {
18 return false
19}
Note: See TracBrowser for help on using the repository browser.