Merge "Improve dumb terminal detection"

This commit is contained in:
Treehugger Robot
2019-06-29 02:45:43 +00:00
committed by Gerrit Code Review

View File

@@ -23,6 +23,9 @@ import (
)
func isSmartTerminal(w io.Writer) bool {
if term, ok := os.LookupEnv("TERM"); ok && term == "dumb" {
return false
}
if f, ok := w.(*os.File); ok {
var termios syscall.Termios
_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, f.Fd(),