resize
resize: set or show the terminal’s size.
Synopsis
resize [-s rows columns]
Description
resize asks the terminal how big it is, tells the kernel (so the program in front gets SIGWINCH, and looks again), and prints shell commands setting COLUMNS and LINES, for eval.
A terminal powers on at the largest its tier shows: 50 by 16 (tier 1), 80 by 25 (tier 2), 160 by 50 (tier 3). It can be made smaller, and larger again up to that. In the console’s group (every screen the console shows on), the largest is what every one of them can show, and they’re all the same size.
Options
- -s rows columns
- First asks the terminal to be rows by columns (xterm’s sequence, ESC[8;rows;columnst), no larger than it can be; 0 is the largest. Text that no longer fits is dropped (lines above the cursor go into the scrollback first), and nothing is wrapped again.
Exit status
0 on success; 1 for a bad argument, or when the terminal didn’t answer.
Examples
resize -s 25 80
resize -s 0 0
eval $(resize)
Notes
As xterm’s, it talks to its terminal with escape sequences through /dev/tty: a program can do the same (ESC[18t asks the size, ESC[19t the largest). A program that resizes the terminal itself, without telling the kernel, leaves the program in front unaware until it asks again.
See also
stty(1)