fix: use term package to check if is a terminal

pull/284/head
sammyette 2024-04-06 18:27:22 -04:00
parent 11323a70aa
commit 20761e754c
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 1 additions and 1 deletions

View File

@ -88,7 +88,7 @@ func main() {
interactive = true
}
if fileInfo, _ := os.Stdin.Stat(); (fileInfo.Mode() & os.ModeCharDevice) == 0 {
if fileInfo, _ := os.Stdin.Stat(); (fileInfo.Mode() & os.ModeCharDevice) == 0 || !term.IsTerminal(int(os.Stdin.Fd())) {
interactive = false
}