annotate vendor/github.com/sirupsen/logrus/terminal_check_bsd.go @ 69:03019bbf2e0e
draft
Fix a bug that I caused
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>
author |
yakumo.izuru |
date |
Sat, 16 Sep 2023 16:11:35 +0000 |
parents |
787b5ee0289d |
children |
|
rev |
line source |
66
|
1 // +build darwin dragonfly freebsd netbsd openbsd
|
|
2 // +build !js
|
|
3
|
|
4 package logrus
|
|
5
|
|
6 import "golang.org/x/sys/unix"
|
|
7
|
|
8 const ioctlReadTermios = unix.TIOCGETA
|
|
9
|
|
10 func isTerminal(fd int) bool {
|
|
11 _, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
|
|
12 return err == nil
|
|
13 }
|