Hello Dale!

> Martin Schulte <g...@schrader-schulte.de> writes:
> > I'm just wondering that bash (reproduced with 5.2-rc1 under Debian 11)
> > seems to determine LINES and COLUMNS from stderr.
> 
> It's not clear to me that the manual page says where the LINES and
> COLUMNS values are obtained from.

Sorry, maybe my mail was somewhat too short...

I didn't find anything in the man pages that states where these variables are 
obtained from.

To show the behaviour do the following:
- Open a (resizable) terminal window (with a bash in it), say it is /dev/pts/5
- In a second terminal window start the script
#!/bin/bash

shopt -s checkwinsize
trap 'echo $LINES $COLUMNS' SIGWINCH
while true; do sleep 0.1; done

with ./winsize 2> /dev/pts/5

Whenn you now resize this window, the script will show you the size of the 
other one.

The sources (get_new_windows_size in lib/sh/winsize.c) seem to explain well why 
this happens.

Hope this helps to understand the problem!

Best regards

Martin

Reply via email to