From c750ef09e1571fbdb36d408ff894ed2bbcc80014 Mon Sep 17 00:00:00 2001 From: Péter Szilágyi Date: Tue, 5 May 2015 13:24:15 +0300 Subject: cmd/geth: fix #853 colorize console output in windows --- .../src/github.com/mattn/go-isatty/isatty_bsd.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Godeps/_workspace/src/github.com/mattn/go-isatty/isatty_bsd.go (limited to 'Godeps/_workspace/src/github.com/mattn/go-isatty/isatty_bsd.go') diff --git a/Godeps/_workspace/src/github.com/mattn/go-isatty/isatty_bsd.go b/Godeps/_workspace/src/github.com/mattn/go-isatty/isatty_bsd.go new file mode 100644 index 000000000..035274751 --- /dev/null +++ b/Godeps/_workspace/src/github.com/mattn/go-isatty/isatty_bsd.go @@ -0,0 +1,17 @@ +// +build darwin freebsd + +package isatty + +import ( + "syscall" + "unsafe" +) + +const ioctlReadTermios = syscall.TIOCGETA + +// IsTerminal return true if the file descriptor is terminal. +func IsTerminal(fd uintptr) bool { + var termios syscall.Termios + _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) + return err == 0 +} -- cgit