Subject: Re: window resizing not updating COLUMNS and LINES
From: "Ehud Karni" <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Sat, 3 Jun 2006 23:32:37 +0300

On  Wed, 31 May 2006 18:47:24 -0500, mwoehlke wrote:
> >
> > 'export COLUMNS' is needed for 'printenv COLUMNS' to work,
> > since in the printenv case you need the variable to be
> > transferred to the child printenv process.
>
> Ok, that makes sense, although my understanding is that if the child
> process is 'bash' (including a script run by bash), then it will have a
> non-exported copy of the var set correctly. Or rather, it would/should
> if this was working at all.

Here is my finding with cygwin1.dll 1.5.18, bash 3.00.16(11), rxvt v2.7.10

********** note: cygwin1.dll 1.5.18 (OLD) **********

# uname -a
CYGWIN_NT-5.1 p4-1700-xp 1.5.18(0.132/4/2) 2005-07-02 20:30 i686 unknown unknown Cygwin

# echo $LINES $COLUMNS

# export LINES COLUMNS
# echo $LINES $COLUMNS

# stty -a
speed 38400 baud; rows 49; columns 105; line = 0;  .....

========== [ change of rxvt screen size by the mouse ] ==========

# echo $LINES $COLUMNS
47 105
# stty -a
speed 38400 baud; rows 47; columns 105; line = 0;  .....

========== [ change of rxvt screen size by the mouse ] ==========

# echo $LINES $COLUMNS
49 91
# stty -a
speed 38400 baud; rows 49; columns 91; line = 0;  .....

I get the exact same results with xterm 6.8.2.0(202).

My conclusions:

Both rxvt and xterm do their job properly.

The export is not needed (LINES and COLUMNS are local variables).
The stty does not set these vars. (both tested separately, not shown).

The bash variables are not set until the window change size
(until bash gets the SIGWINCH signal ? ).

Since it seems to work fine (almost), I guess the problem is with
cygwin1.dll 1.5.19.

Ehud.

BTW. On linux (locally compiled bash) the LINES & COLUMNS are set
     even before changing window size.

--
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D <http://www.keyserver.net/>    Better Safe Than Sorry

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/