Re: LINES and COLUMNS

Chet Ramey <[email protected]> Mon, 6 Apr 2026 11:28:06 -0400
Newsgroups gmane.comp.shells.bash.bugs
Organization ITS, Case Western Reserve University
Message-ID <[email protected]>
On 4/2/26 11:22 PM, Zachary Santer wrote:

> Why do this?

Because when job control is enabled, the shell does not get SIGWINCH, which
is sent to the terminal's foreground process group. Without setting the
window size after each external command runs, the shell would miss window
size changes.

Users requested this to be the default, but you can compile bash to have
checkwinsize initially disabled.

> Why not just set the values of LINES and COLUMNS when the
> script begins to run,

Because users expect the shell to honor the values they pass in the
environment.

> or whenever checkwinsize is enabled, if it had
> been disabled?

For the same reason. No reason to reset the window size if the user has
specified something different in the environment, but by setting it, the
user has indicated an interest in its effects when running external
programs.

> And then upon SIGWINCH also in a noninteractive shell?

There haven't really been requests to do this, and it would also override
any environment settings.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc (application/pgp-signature, 203 B)
-----BEGIN PGP SIGNATURE-----

wmMEABEIACMWIQR8ATX7CIqvbGbGULm7WGnwZOp0qwUCadPRBgUDAAAAAAAKCRC7WGnwZOp0q9g1
AJ9LDpVbeZzo8mKEN79pgPqFb1egXACeOIGhTJNgi6cEYy1naAh9LoJIDZo=
=ylsk
-----END PGP SIGNATURE-----