Re: [doc] LINES/COLUMNS auto-update in non-interactive shells contradicts manual
Chet Ramey <[email protected]> Mon, 11 May 2026 11:47:15 -0400
| Newsgroups | gmane.comp.shells.bash.bugs |
|---|---|
| Organization | ITS, Case Western Reserve University |
| Message-ID | <[email protected]> |
On 5/10/26 5:10 PM, Zachary Santer wrote:
> In fact, they're currently set in a noninteractive shell after any
> external command runs, if checkwinsize is enabled.
The description of checkwinsize already says this, and did in bash-5.1.
> They may as well be made to work the same in a noninteractive shell as
> they do in an interactive one.
Interactive shells handle SIGWINCH for the benefit of readline(), since
that's what people expect. There is less reason to do that in a non-
interactive shell.
>>> 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.
It's easy to do
shopt -u checkwinsize
: ${LINES:=24} ${COLUMNS:=80}
if it matters, without having to wait for any changes to the shell. TheOP
is already two major versions back.
--
``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----- wmMEABEIACMWIQR8ATX7CIqvbGbGULm7WGnwZOp0qwUCagH6AwUDAAAAAAAKCRC7WGnwZOp0q1PN AJ9swIYBMS+D9kuyUYDNRpljF6Ek1QCfaAp7jSmeveVRVC5LxVEh8FPcHjg= =Oq8G -----END PGP SIGNATURE-----