Hi Zack On Fri, 3 Apr 2026, 16:22 Zachary Santer, <[email protected]> wrote:
> Why do this? Why not just set the values of LINES and COLUMNS when the > script begins to run, or whenever checkwinsize is enabled, if it had > been disabled? And then upon SIGWINCH also in a noninteractive shell? > SIGWINCH is delivered to the foreground process group. While an external command is running that generally does not include the shell itself, hence the need to check after each external command. Perhaps it would be clearer to document this along the lines of: "the current terminal size is queried in response to SIGWINCH, as well as any time the shell changes the foreground process group to itself." The tcgetattr ioctl syscall is very cheap; it's not really worth trying to optimise it. -Martin >
