aboutsummaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/mattn/go-isatty/isatty_bsd.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-05-05 18:24:15 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-05-05 19:44:39 +0800
commitc750ef09e1571fbdb36d408ff894ed2bbcc80014 (patch)
tree54fbe761882dd7c6eba364ecd93a2fb32ae68ab5 /Godeps/_workspace/src/github.com/mattn/go-isatty/isatty_bsd.go
parentac85fdc75edfaf999a7b2d25c5313c1b3eeb86ad (diff)
downloadgo-tangerine-c750ef09e1571fbdb36d408ff894ed2bbcc80014.tar.gz
go-tangerine-c750ef09e1571fbdb36d408ff894ed2bbcc80014.tar.zst
go-tangerine-c750ef09e1571fbdb36d408ff894ed2bbcc80014.zip
cmd/geth: fix #853 colorize console output in windows
Diffstat (limited to 'Godeps/_workspace/src/github.com/mattn/go-isatty/isatty_bsd.go')
-rw-r--r--Godeps/_workspace/src/github.com/mattn/go-isatty/isatty_bsd.go17
1 files changed, 17 insertions, 0 deletions
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
+}