Re: [doc] LINES/COLUMNS auto-update in non-interactive shells contradict
From:
Chet Ramey
Subject:
Re: [doc] LINES/COLUMNS auto-update in non-interactive shells contradicts manual
Date:
Mon, 11 May 2026 11:47:15 -0400
User-agent:
Mozilla Thunderbird
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 chet@case.edu http://tiswww.cwru.edu/~chet/