summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mikhail Naganov <mnaganov@google.com> 2019-06-27 10:54:53 -0700
committer Mikhail Naganov <mnaganov@google.com> 2019-06-27 10:54:53 -0700
commitb073581441bf4d69c84e1658cf78e07c3f73a3bd (patch)
tree0c08aebaa9b7285a5c4d10d5fa2d70d1d13dc8b1
parent8a255acae24bd839c77e59d5196ec8931bb5b20b (diff)
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
-rw-r--r--ui/terminal/util.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/terminal/util.go b/ui/terminal/util.go
index c9377f156..f383ef19e 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(),