8 Star 8 Fork 2

ShirDon-廖显东/goTerminal

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
terminal_bsd.go 623 Bytes
一键复制 编辑 原始数据 按行查看 历史
ShirDon-廖显东 提交于 5年前 . commit
// +build darwin freebsd openbsd netbsd dragonfly
// +build !appengine
package goterminal
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
}
// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
// terminal. This is also always false on this environment.
func IsCygwinTerminal(fd uintptr) bool {
return false
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/shirdonl/goTerminal.git
git@gitee.com:shirdonl/goTerminal.git
shirdonl
goTerminal
goTerminal
e705f5d74483

搜索帮助

371d5123 14472233 46e8bd33 14472233