aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/mattn/go-isatty/isatty_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mattn/go-isatty/isatty_linux.go')
-rw-r--r--vendor/github.com/mattn/go-isatty/isatty_linux.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/vendor/github.com/mattn/go-isatty/isatty_linux.go b/vendor/github.com/mattn/go-isatty/isatty_linux.go
index 9d24bac..e004038 100644
--- a/vendor/github.com/mattn/go-isatty/isatty_linux.go
+++ b/vendor/github.com/mattn/go-isatty/isatty_linux.go
@@ -3,16 +3,16 @@
3 3
4package isatty 4package isatty
5 5
6import ( 6import "golang.org/x/sys/unix"
7 "syscall"
8 "unsafe"
9)
10
11const ioctlReadTermios = syscall.TCGETS
12 7
13// IsTerminal return true if the file descriptor is terminal. 8// IsTerminal return true if the file descriptor is terminal.
14func IsTerminal(fd uintptr) bool { 9func IsTerminal(fd uintptr) bool {
15 var termios syscall.Termios 10 _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS)
16 _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 11 return err == nil
17 return err == 0 12}
13
14// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
15// terminal. This is also always false on this environment.
16func IsCygwinTerminal(fd uintptr) bool {
17 return false
18} 18}