Files
abra/vendor/github.com/muesli/termenv/termenv_posix.go
decentral1se 1723025fbf
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
build: go 1.24
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.
2025-03-16 12:31:45 +01:00

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()
}