Skip to content
The Signal Belfry

/static/campanario/en/sino/sigwinch/

Menu

SIG-025 · The user's

SIGWINCH

The window changed size — the bell that makes the whole terminal redraw.

Window change: born in 4.3BSD, when the terminal stopped being a fixed-width teletype and became a window the mouse can stretch. On a resize, the emulator tells the kernel, and the kernel rings this bell for the foreground group.

Ignored by default — plain text doesn't care about width —, yet it is the heart of every terminal interface: vim, tmux and less catch it, ask for the new size with ioctl(TIOCGWINSZ) and redraw everything. Without it, every resize would leave the screen in ruins.

$ trap 'printf "%s columns now\n" "$(tput cols)"' WINCH
$ (drag the edge of the terminal window)
132 columns now
The terminal stretched; whoever was watching found out.