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
This commit is contained in:
parent
8a255acae2
commit
b073581441
|
@ -23,6 +23,9 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func isSmartTerminal(w io.Writer) bool {
|
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 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(),
|
||||||
|
|
Loading…
Reference in New Issue