Merge "Improve dumb terminal detection"
This commit is contained in:
commit
a3ded95424
1 changed files with 3 additions and 0 deletions
|
@ -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 a new issue