This commit is contained in:
兔子 2021-07-07 11:42:33 +08:00
parent 00cc2eaa21
commit 0e91e97132

View File

@ -3,6 +3,8 @@
package isatty
import "golang.org/x/sys/unix"
// IsTerminal return true if the file descriptor is terminal.
func IsTerminal(fd uintptr) bool {
_, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA)