2026年4月3日(金) 15:13 Martin D Kealey <[email protected]>:
> On Fri, 3 Apr 2026, 16:22 Zachary Santer, <[email protected]> wrote:
> > [...] Why not just set the values of LINES and COLUMNS when the
> > script begins to run,

That breaks the idiom of COLUMNS to restrict the widths of the output.
Some programs use COLUMNS to automatically wrap lines in their output,
and users conventionally call such programs as « COLUMNS=80
./script.sh » to adjust the widths of the output.

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

I think this is a good idea (unless I overlooked something). To get
LINES and COLUMNS in a script, we typically fork a dummy subshell (:)
(or spawn a process like /bin/true) after setting checkwinsize, e.g.
as done in Ref. [1], but it seems reasonable to update LINES and
COLUMNS immediately after checkwinsize is set.

[1] 
https://github.com/akinomyoga/ble.sh/blob/b99cadb4520a1fdec0067fdc007b39cc905ecbad/src/util.sh#L7165-L7166

> > And then upon SIGWINCH also in a noninteractive shell?

This also breaks « COLUMNS=80 ./script.sh ».

--
Koichi

Reply via email to