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?
termiosmodule documentation (docs.python.org/3/library/termios.html#module-termios) doesn't give a list of theioctlrequestconstants that it brings in... but you can go look at the source code: github.com/python/cpython/blob/… and for more information refer to your particular OS manual pages or, for more standard ones, the standard: pubs.opengroup.org/onlinepubs/9699919799/basedefs/… - rakslice