From d912eb6c557fb8d14a3530fb2d76ae6ddd752fd8 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Thu, 27 Jun 2019 10:54:53 -0700 Subject: Improve dumb terminal detection When figuring out terminal type, check whether TERM=dumb is set. Test: m nothing Test: TERM=dumb m nothing Test: m nothing | tee log Change-Id: Ie13ca99eb84b798644d618ad1c8c1fb8ec8bb049 --- ui/terminal/util.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ui/terminal/util.go') diff --git a/ui/terminal/util.go b/ui/terminal/util.go index c9377f15..f383ef19 100644 --- a/ui/terminal/util.go +++ b/ui/terminal/util.go @@ -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(), -- cgit v1.2.3