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
Description: OpenPGP digital signature
