diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-05-05 18:24:15 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-05-05 19:44:39 +0800 |
commit | c750ef09e1571fbdb36d408ff894ed2bbcc80014 (patch) | |
tree | 54fbe761882dd7c6eba364ecd93a2fb32ae68ab5 /Godeps/_workspace/src/github.com/mattn/go-isatty/isatty_bsd.go | |
parent | ac85fdc75edfaf999a7b2d25c5313c1b3eeb86ad (diff) | |
download | go-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.go | 17 |
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 +} |