We were running behind and there were quite some deprecations to update. This was mostly in the upstream copy/pasta package but seems quite minimal.
18 lines
347 B
Go
18 lines
347 B
Go
//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || zos
|
|
// +build darwin dragonfly freebsd linux netbsd openbsd zos
|
|
|
|
package termenv
|
|
|
|
import (
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func isForeground(fd int) bool {
|
|
pgrp, err := unix.IoctlGetInt(fd, unix.TIOCGPGRP)
|
|
if err != nil {
|
|
return false
|
|
}
|
|
|
|
return pgrp == unix.Getpgrp()
|
|
}
|