mirror of
https://github.com/peco/peco.git
synced 2026-09-12 16:26:17 -04:00
22 lines
324 B
Go
22 lines
324 B
Go
// +build linux
|
|
|
|
package peco
|
|
|
|
import (
|
|
"syscall"
|
|
"unsafe"
|
|
)
|
|
|
|
func IsTty(fd uintptr) bool {
|
|
var termios syscall.Termios
|
|
_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, uintptr(syscall.TCGETS), uintptr(unsafe.Pointer(&termios)), 0, 0, 0)
|
|
return err == 0
|
|
}
|
|
|
|
func TtyReady() error {
|
|
return nil
|
|
}
|
|
|
|
func TtyTerm() {
|
|
}
|