On 5/10/26 5:13 AM, Ilya Tsoy via Bug reports for the GNU Bourne Again SHell wrote:

Bash Version: 5.1
Patch Level: 16
Release Status: release

This is very old. I understand that it's not your decision.


Description:
The bash(1) manual states that LINES and COLUMNS are "automatically set
... in an interactive shell upon receipt of a SIGWINCH".

The bash-5.3 man page says:

"Automatically set if the
 checkwinsize option is enabled or in an interactive  shell  upon
 receipt of a SIGWINCH."

And the description of checkwinsize describes the behavior and says it's
enabled by default.

This silently breaks scripts that use LINES or COLUMNS as user variables

Using LINES or COLUMNS for some different purpose is unwise: Unix programs
have used these variables with the same semantics bash applies to them for
literally decades.

POSIX warns against using these and other common variables:

"It is unwise to conflict with certain variables that are frequently
exported by widely used command interpreters and applications:"

and LINES and COLUMNS are in that list, among many others.

https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap08.html#tag_08_03


Fix:
A documentation patch clarifying that LINES/COLUMNS may be updated in
any shell where checkwinsize is enabled and a TTY is available,

Even the bash-5.1 man page says this.

--
``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/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to