This commit is contained in:
22
vendor/github.com/muesli/termenv/termenv_solaris.go
generated
vendored
Normal file
22
vendor/github.com/muesli/termenv/termenv_solaris.go
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
//go:build solaris || illumos
|
||||
// +build solaris illumos
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
g, err := unix.Getpgrp()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return pgrp == g
|
||||
}
|
Reference in New Issue
Block a user