Issue 1511 - emacs pretends it has a tty

This commit is contained in:
Thomas Nagy 2014-11-20 21:20:46 +01:00
parent 1689bc658a
commit 740763c236
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
1 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ console commands.
"""
import re, sys
import os, re, sys
from waflib.Utils import threading
wlock = threading.Lock()
@ -329,7 +329,7 @@ try:
except ImportError:
pass
else:
if sys.stdout.isatty() or sys.stderr.isatty():
if (sys.stdout.isatty() or sys.stderr.isatty()) and os.environ.get('TERM', '') not in ('dumb', 'emacs'):
FD = sys.stdout.isatty() and sys.stdout.fileno() or sys.stderr.fileno()
def fun():
return struct.unpack("HHHH", fcntl.ioctl(FD, termios.TIOCGWINSZ, struct.pack("HHHH", 0, 0, 0, 0)))[1]