Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6be3939c authored by Mikhail Naganov's avatar Mikhail Naganov Committed by android-build-merger
Browse files

Merge "Improve dumb terminal detection"

am: a3ded954

Change-Id: I8e602bcfd343f6d7ec2163460c89956d0eccdbbc
parents 1b4699a2 a3ded954
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -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(),