File: terminal_check_unix.go

package info (click to toggle)
golang-logrus 1.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports, bookworm-proposed-updates, experimental, forky, sid, trixie
  • size: 432 kB
  • sloc: sh: 7; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 231 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
// +build linux aix zos
// +build !js

package logrus

import "golang.org/x/sys/unix"

const ioctlReadTermios = unix.TCGETS

func isTerminal(fd int) bool {
	_, err := unix.IoctlGetTermios(fd, ioctlReadTermios)
	return err == nil
}