I want to get the size of the terminal. I am using this functionality:
import sys, struct, fcntl, termios
s = struct.pack('HHHH', 0, 0, 0, 0)
t = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ, s)
print(struct.unpack('HHHH', t))
But what on earth is termios.TIOCGWINSZ
?