8.3 SIGWINCH

This signal is sent to a process when the size (dimension) of the terminal attached to the process changes. The default disposition of this signal is ignored. In other words, even though the kernel sends this signal to a process, a process continues to execute as if the signal was not sent.

Upon reception of this signal, an application can discover its new window size using the following snippet of code:

#include <sys/ioctl.h> 
/* ... */ 
{ 
  struct winsize ws; 
 
  ioctl(STDOUT, TIOCGWINSZ, &ws); 
  /* ws.ws_row and ws.ws_col reflect the current row and col size */ 
}