Files
go2rtc/pkg/shell/tty_windows.go
T
2024-05-28 10:19:51 +03:00

20 lines
366 B
Go

//go:build windows
package shell
import (
"syscall"
"unsafe"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")
procGetConsoleMode = kernel32.NewProc("GetConsoleMode")
)
func IsInteractive(fd uintptr) bool {
var st uint32
r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0)
return r != 0 && e == 0
}