RESIZE(1)
๐ RESIZE(1) โ bestie, your terminal is about to get โจresizedโจ ๐
okay so this is resize, from the X Window System manuals, and it is lowkey the most useful little gremlin you will ever meet ๐ซถ
๐ธ NAME ๐ธ
resize โ set environment and terminal settings to current xterm window size
like. it tells your shell how big your window actually is. main character energy fr ๐
โจ SYNOPSIS โจ
resize [ -v | -u | -c ] [ -s [ row col ] ]
๐ฆ DESCRIPTION ๐ฆ
So resize prints a shell command for setting the appropriate environment variables to indicate the current size of the xterm window from which the command is run. no cap, that's the whole job ๐
Here's the way it figures out that command, step by step:
- first, it finds the name of the user's shell program. It uses the
SHELLvariable if set, otherwise it uses the user's data from/etc/passwd. - then it decides whether to use Bourne shell syntax or C-Shell syntax. It uses a built-in table of known shells, which can be overridden by the
-uand-coptions. - then
resizeasks the operating system for the terminal settings. This is the same information which can be manipulated usingstty. - then
resizeasks the terminal for its size in characters. Depending on whether the-soption is given,resizeuses a different escape sequence to ask for this information. - at this point,
resizeattempts to update the terminal settings to reflect the terminal window's size in pixels:- if the
-soption is used,resizethen asks the terminal for its size in pixels. - otherwise,
resizeasks the operating system for the information and updates that after ensuring that the window's dimensions are a multiple of the character height and width. - in either case, the updated terminal settings are done using a different system call than used for
stty.
- if the
- then
resizeupdates the terminal settings to reflect any altered values such as its size in rows or columns. This affects the values shown bystty. - finally,
resizegenerates shell commands for setting the environment variables, and writes that to the standard output.
it's giving "pipeline of small tasks that all slay individually" ๐
๐ OPTIONS ๐
The following options may be used with resize:
-cโ This option indicates that C shell commands should be generated even if the user's current shell does not appear to use C shell syntax.-s[rows columns] โ This option indicates that Sun console escape sequences will be used instead of the VT100-style xterm escape codes. If rows and columns are given,resizewill ask the xterm to resize itself using those values.
Both of the escape sequences used for this option (first to obtain the window size and second to modify it) are subject to xterm's allowWindowOps resource setting. The window manager may also choose to disallow the change.
The VT100-style escape sequence used to determine the screen size always works for VT100-compatible terminals. VT100s have no corresponding way to modify the screensize.
โ ๏ธ bestie listen. those two escape sequences are at the mercy of xterm's allowWindowOps resource, and your window manager can also just say no. it's not a bug it's a boundary ๐
-uโ This option indicates that Bourne shell commands should be generated even if the user's current shell does not appear to use Bourne shell syntax.-vโ This causesresizeto print a version number to the standard output, and then exit.
Note that the Sun console escape sequences are recognized by XFree86 xterm and by dtterm. The resize program may be installed as sunsize, which causes makes it assume the -s option. ๐ฅ
The rows and columns arguments must appear last; though they are normally associated with the -s option, they are parsed separately. (yes it's a little unhinged. it's iconic. we love her.) ๐
๐ ENVIRONMENT ๐
SHELLโ Unless overridden by the-coption,resizedetermines the user's current shell by- first checking if
$SHELLis set, and using that, - otherwise
resizelooks in the password file (/etc/passwd).
- first checking if
Generally Bourne-shell variants (including ksh) do not modify $SHELL, so it is possible for resize to be confused if one runs resize from a Bourne shell spawned from a C shell.
After determining the user's shell, resize checks the shell's name against a table of known shell names. If it does not find the name in its table, resize will use C shell syntax for the generated commands to set environment variables.
๐ญ not the Bourne-shell-inside-a-C-shell situation. that's the classic way to confuse her, just so you know.
TERMโ Resize's generated shell command sets this to"xterm"if not already set.TERMCAPโ Resize's generated shell command sets this variable on systems using termcap, e.g., whenresizeis linked with the termcap library rather than a terminfo library. The latter does not provide the complete text for a termcap entry.COLUMNS,LINESโ Resize's generated shell command sets these variables on systems using terminfo. Many applications (including the curses library) use those variables when set to override their screensize.
๐ FILES ๐
/etc/termcapโ for the base termcap entry to modify.~/.cshrcโ user's alias for the command.
๐ EXAMPLES ๐
For resize's output to take effect, resize must either be evaluated as part of the command line (usually done with a shell alias or function) or else redirected to a file which can then be read in. From the C shell (usually known as /bin/csh), the following alias could be defined in the user's .cshrc:
% alias rs 'set noglob; eval `resize`'
After resizing the window, the user would type:
% rs
Users of versions of the Bourne shell (usually known as /bin/sh) that don't have command functions will need to send the output to a temporary file and then read it back in with the โ.โ command:
$ resize > /tmp/out
$ . /tmp/out
see? not scary. literally just eval it or source it, and you're done ๐ธ
๐ AUTHORS ๐
Mark Vandevoorde (MIT-Athena), Edward Moy (Berkeley) Thomas Dickey (invisible-island.net). Copyright (c) 1984, 1985 by X Consortium See X(7) for a complete copyright notice.
๐ซถ SEE ALSO ๐ซถ
and that's the whole page, bestie!! this lil gem is from Patch #411, dated 2026-08-24 โ go forth and resize responsibly ๐โจ๐
๐ฆ where this page comes from
- fedora 43: xterm-resize 411-1.fc43 ยท MIT AND X11 AND HPND AND CC-BY-4.0
- fedora 44: xterm-resize 411-1.fc44 ยท MIT AND X11 AND HPND AND CC-BY-4.0
- ubuntu stonking: xterm 411-1ubuntu1
- Copyright 1998-2024,2025 by Thomas E. Dickey
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms