winsize
Winsize refers to the terminal window size data structure used in Unix-like systems to describe the dimensions of a terminal in characters and, optionally, pixels. It is central to programs that need to adapt their text-based user interfaces to the current size of the terminal, such as full-screen editors, pagers, and terminal multiplexers.
The data structure is commonly exposed as struct winsize and typically contains four fields: ws_row for the
Access to the terminal size is performed via the ioctl system call using the TIOCGWINSZ request to
Header declarations for struct winsize appear in system headers such as <sys/ioctl.h>, with some systems providing
Applications relying on winsize include terminal-based editors and applications, screen and tmux, and libraries such as