mirror of https://gitlab.com/ita1024/waf.git
Issue 1511 - emacs pretends it has a tty
This commit is contained in:
parent
1689bc658a
commit
740763c236
|
@ -11,7 +11,7 @@ console commands.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import re, sys
|
import os, re, sys
|
||||||
from waflib.Utils import threading
|
from waflib.Utils import threading
|
||||||
|
|
||||||
wlock = threading.Lock()
|
wlock = threading.Lock()
|
||||||
|
@ -329,7 +329,7 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
else:
|
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()
|
FD = sys.stdout.isatty() and sys.stdout.fileno() or sys.stderr.fileno()
|
||||||
def fun():
|
def fun():
|
||||||
return struct.unpack("HHHH", fcntl.ioctl(FD, termios.TIOCGWINSZ, struct.pack("HHHH", 0, 0, 0, 0)))[1]
|
return struct.unpack("HHHH", fcntl.ioctl(FD, termios.TIOCGWINSZ, struct.pack("HHHH", 0, 0, 0, 0)))[1]
|
||||||
|
|
Loading…
Reference in New Issue