Moved moved unix-related parts into terminal

This commit is contained in:
Andrey Tcherepanov
2019-03-26 14:53:49 -06:00
parent 7de3dd8c8b
commit 41ee4dd365
6 changed files with 28 additions and 27 deletions
+2 -4
View File
@@ -6,15 +6,13 @@ import (
"io"
"os"
"golang.org/x/sys/unix"
"github.com/sirupsen/logrus/internal/terminal"
)
func checkIfTerminal(w io.Writer) bool {
switch v := w.(type) {
case *os.File:
_, err := unix.IoctlGetTermios(int(v.Fd()), ioctlReadTermios)
return err == nil
return terminal.IsTerminal(int(v.Fd()))
default:
return false
}