diff options
author | 2019-07-02 09:51:42 -0700 | |
---|---|---|
committer | 2019-07-02 09:51:42 -0700 | |
commit | 9d42425f25b30c67b51b8c33751f2960b15a910d (patch) | |
tree | 926b8a2cc0a4c19cdc2d51d3334d5e904ea07b6e /ui/terminal/util.go | |
parent | aebc02ab29648b5f4a69636222e3d80888a90dd3 (diff) |
Perform TERM check for file writers only
Tests use fakeSmartTerminal, this case must not be affected
by the TERM setting.
Test: TERM=dumb make
Change-Id: Ib926a1c6ba2d8c4117d412fe351d872ccfc1c799
Diffstat (limited to 'ui/terminal/util.go')
-rw-r--r-- | ui/terminal/util.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/terminal/util.go b/ui/terminal/util.go index f383ef19e..7a603d7f7 100644 --- a/ui/terminal/util.go +++ b/ui/terminal/util.go @@ -23,10 +23,10 @@ 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 { + if term, ok := os.LookupEnv("TERM"); ok && term == "dumb" { + return false + } var termios syscall.Termios _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, f.Fd(), ioctlGetTermios, uintptr(unsafe.Pointer(&termios)), |