mirror of
https://github.com/rancher/os.git
synced 2025-06-19 03:31:55 +00:00
15 lines
288 B
Go
15 lines
288 B
Go
|
package util
|
||
|
|
||
|
import (
|
||
|
"github.com/kless/term"
|
||
|
|
||
|
log "github.com/Sirupsen/logrus"
|
||
|
)
|
||
|
|
||
|
func IsRunningInTty() bool {
|
||
|
log.Infof("Is a tty : %v", term.IsTerminal(0))
|
||
|
log.Infof("Is a tty : %v", term.IsTerminal(1))
|
||
|
log.Infof("Is a tty : %v", term.IsTerminal(2))
|
||
|
return term.IsTerminal(1)
|
||
|
}
|