1 Star 0 Fork 0

kirileec / color

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
isatty_linux.go 404 Bytes
一键复制 编辑 原始数据 按行查看 历史
kirileec 提交于 2019-09-21 21:57 . 合并
// +build linux
// +build !appengine,!ppc64,!ppc64le
package color
import (
"syscall"
"unsafe"
)
const ioctlReadTermios = syscall.TCGETS
// 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
}
Go
1
https://gitee.com/kirile/color.git
git@gitee.com:kirile/color.git
kirile
color
color
v1.0.2

搜索帮助