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.i
It is a magic constant determined by the system you are running on resp. by the terminal driver.
In combination with ioctl()
, it serves to tell exectly what you want, in your case call IOCtl to Get the Window Size. Thus the name TIOCGWINSZ
, IOC
tl to G
et the WIN
dow S
iZ
e.
This bit of documentation might help you clear things up.