This commit is contained in:
Kovid Goyal 2015-11-09 15:09:13 +05:30
parent 2b7cef952b
commit a0c0a3ffbb

View File

@ -330,7 +330,7 @@ def get_term_geometry():
def ioctl_GWINSZ(fd): def ioctl_GWINSZ(fd):
try: try:
return struct.unpack(b'hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, b'1234')) return struct.unpack(b'HHHH', fcntl.ioctl(fd, termios.TIOCGWINSZ, b'\0'*8))[:2]
except Exception: except Exception:
return None, None return None, None