aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorMikhail Naganov <mnaganov@google.com>2019-06-27 10:54:53 -0700
committerMichael Bestas <mkbestas@lineageos.org>2019-12-11 19:03:31 +0200
commita1447979d6df897af2910ba7c44d5ebbef5df56c (patch)
treed34f88d1ddf38751b1b4be6d37107c6addcf9955 /ui
parentc3be6041656517d2fd777496f1e8790bddd17aaf (diff)
downloadbuild_soong-a1447979d6df897af2910ba7c44d5ebbef5df56c.tar.gz
build_soong-a1447979d6df897af2910ba7c44d5ebbef5df56c.tar.bz2
build_soong-a1447979d6df897af2910ba7c44d5ebbef5df56c.zip
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
Diffstat (limited to 'ui')
-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 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(),