1package ui 2 3import ( 4 "os" 5 6 "golang.org/x/term" 7) 8 9// IsInteractive returns true if stdin is connected to a terminal 10func IsInteractive() bool { 11 return term.IsTerminal(int(os.Stdin.Fd())) 12}