From a0c0a3ffbbe0e0454065cd0817733a34394cd19e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 9 Nov 2015 15:09:13 +0530 Subject: [PATCH] ... --- src/calibre/utils/terminal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/utils/terminal.py b/src/calibre/utils/terminal.py index 8f899396d8..0632803e18 100644 --- a/src/calibre/utils/terminal.py +++ b/src/calibre/utils/terminal.py @@ -330,7 +330,7 @@ def get_term_geometry(): def ioctl_GWINSZ(fd): 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: return None, None