SIGWINCH

From Wikipedia, the free encyclopedia

SIGWINCH (non-POSIX)
Description Window resize signal (4.3BSD, Sun)
Default action Ignore the signal
SA_SIGINFO macros
None

On some Unix-like platforms, SIGWINCH is the signal sent to a computer program when its controlling terminal changes size. The symbolic constant for SIGWINCH is defined in the header file signal.h. Symbolic signal names are used because signal numbers can vary across platforms.

[edit] Etymology

SIG is a common prefix for signal names. WINCH is an abbreviation for window [size] change.

[edit] Usage

SIGWINCH is sent when the controlling terminal of a process changes dimensions. Typically this occurs when an xterm or other terminal emulator running in a windowing system is resized, although it can also occur on a text console, for example when the user is running a text windowing system such as GNU Screen. Processes that handle SIGWINCH can use it as an opportunity to find out the new dimensions of the terminal and adjust accordingly (in ncurses-based applications, resizing dialog boxes; in the shell, setting the values of the COLUMNS and LINES environment variables).

Usually it's used to fix the following problem: Terminals crap on greater than 80 columns.

Languages