8 Star 8 Fork 2

BarryLiao-廖显东 / goTerminal

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
terminal_plan9.go 496 Bytes
一键复制 编辑 原始数据 按行查看 历史
BarryLiao-廖显东 提交于 2019-12-01 20:33 . commit
// +build plan9
package goterminal
import (
"syscall"
)
// IsTerminal returns true if the given file descriptor is a terminal.
func IsTerminal(fd uintptr) bool {
path, err := syscall.Fd2path(int(fd))
if err != nil {
return false
}
return path == "/dev/cons" || path == "/mnt/term/dev/cons"
}
// 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
}
Go
1
https://gitee.com/shirdonl/goTerminal.git
git@gitee.com:shirdonl/goTerminal.git
shirdonl
goTerminal
goTerminal
master

搜索帮助