LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

resize

Set terminal environment to match window size

TLDR

Ask the terminal to report/update its size (for serial consoles)
$ resize
copy
Print rows/columns in a form usable by the shell
$ resize -s
copy

SYNOPSIS

resize [-u | -c] [-s [rows cols]]

DESCRIPTION

resize prints shell commands to set the COLUMNS and LINES environment variables to the terminal's current dimensions. It communicates with the terminal emulator to determine the actual window size, then outputs commands that can be evaluated to update the environment.The command is particularly useful when the terminal window has been resized and programs need to know the new dimensions, or when working over serial connections where the terminal size may not be automatically detected.

PARAMETERS

-s [rows cols]

Set terminal size (or query if no dimensions given)
-u
Print Stretch shell commands for TERMCAP
-c
Print C shell commands for TERMCAP
-v
Verbose; print escape sequence used

INSTALL

sudo apt install xterm
copy
sudo dnf install xterm
copy
sudo pacman -S xterm
copy
sudo apk add xterm
copy
sudo zypper install xterm
copy
brew install xterm
copy
nix profile install nixpkgs#xterm
copy

CAVEATS

The terminal must support VT100-style size queries. Output must be evaluated by the shell (e.g., eval \`resize\`) to actually set the variables. Modern terminal emulators typically update COLUMNS and LINES automatically via SIGWINCH signals.

HISTORY

Part of xterm utilities, originally written for X Window System terminal emulators. Less commonly needed on modern systems where terminal resizing is handled automatically, but still useful for remote sessions and serial consoles.

SEE ALSO

stty(1), tput(1), xterm(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid