"Resizable" terminals as such are a result of NAWS (Negotiate About Window Size
from RFC 1073 Telnet Window Size Option).
If you are connected directly to the computer using a serial port, there is no negotiation involved, and the computer has no direct knowledge of your terminal's screen-size.
If a terminal can negotiate the size, the computer will send SIGWINCH
to applications running in the terminal, telling them to update their notion of the screensize.
When the computer does not know the screensize, it typically sets the size shown by stty -a
(rows and columns) to zero. For interactive use, this is a little unfriendly, and some systems use environment variables LINES
and COLUMNS
to help. The values assigned may be derived from the terminal description; more often they are simply hardcoded. The convention for these variables requires that they take effect unless explicitly suppressed, e.g., in curses applications use_env
function. On the positive side, those variables can be useful when no reliable information is available. On the negative side, there is no convenient method for altering those variables.
The resize
program (a utility provided with xterm
) can use the VT100-style cursor position report escape sequence for determining the screen size. This can be run from the command-line; there is (again) no convenient way to do it automatically. As a side-effect, resize
updates the information on rows/columns seen by stty
. Its use for providing updated environment variables is mainly useful for cases such as this, where LINES
and COLUMNS
are set, and should be updated.