mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-26 21:47:18 +00:00
10 lines
217 B
Go
10 lines
217 B
Go
|
package term
|
||
|
|
||
|
import "golang.org/x/sys/unix"
|
||
|
|
||
|
// IsTty returns true if the given file descriptor is a terminal.
|
||
|
func IsTty(fd uintptr) bool {
|
||
|
_, err := unix.IoctlGetTermios(int(fd), unix.TCGETA)
|
||
|
return err == nil
|
||
|
}
|