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
This commit is contained in:
@@ -23,10 +23,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func isSmartTerminal(w io.Writer) bool {
|
func isSmartTerminal(w io.Writer) bool {
|
||||||
|
if f, ok := w.(*os.File); ok {
|
||||||
if term, ok := os.LookupEnv("TERM"); ok && term == "dumb" {
|
if term, ok := os.LookupEnv("TERM"); ok && term == "dumb" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if f, ok := w.(*os.File); ok {
|
|
||||||
var termios syscall.Termios
|
var termios syscall.Termios
|
||||||
_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, f.Fd(),
|
_, _, err := syscall.Syscall6(syscall.SYS_IOCTL, f.Fd(),
|
||||||
ioctlGetTermios, uintptr(unsafe.Pointer(&termios)),
|
ioctlGetTermios, uintptr(unsafe.Pointer(&termios)),
|
||||||
|
Reference in New Issue
Block a user