#!/usr/bin/env bash winch() { shopt -s checkwinsize; (:;:) printf '\e[?25l\e[H\e[K%s %sx%s\e[8' "winch!" "$COLUMNS" "$LINES" } trap winch WINCH while : ; do : done