This commit is contained in:
Kovid Goyal 2018-05-10 09:53:17 +05:30
parent dec1203ea8
commit 2819a4ebf3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -92,7 +92,7 @@ def screen_size_function():
buf = array.array('H', [0, 0, 0, 0])
fcntl.ioctl(sys.stdout, termios.TIOCGWINSZ, buf)
rows, cols, width, height = tuple(buf)
cell_width, cell_height = width // cols, height // rows
cell_width, cell_height = width // (cols or 1), height // (rows or 1)
screen_size.ans = Size(rows, cols, width, height, cell_width, cell_height)
screen_size.changed = False
return screen_size.ans