From roberto@keltia.freenix.fr  Fri Jul 12 10:05:59 1996
Received: from mexico.brainstorm.eu.org (root@mexico.brainstorm.eu.org [193.56.58.253])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id KAA26737
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 12 Jul 1996 10:05:55 -0700 (PDT)
Received: from brasil.brainstorm.eu.org (brasil.brainstorm.eu.org [193.56.58.33]) by mexico.brainstorm.eu.org (8.7.5/8.7.3) with ESMTP id TAA03363 for <FreeBSD-gnats-submit@freebsd.org>; Fri, 12 Jul 1996 19:05:49 +0200
Received: (from uucp@localhost) by brasil.brainstorm.eu.org (8.6.12/8.6.12) with UUCP id TAA08609 for FreeBSD-gnats-submit@freebsd.org; Fri, 12 Jul 1996 19:05:08 +0200
Received: (from roberto@localhost) by keltia.freenix.fr (8.8.Alpha.5/keltia-uucp-2.8) id TAA18867; Fri, 12 Jul 1996 19:04:20 +0200 (MET DST)
Message-Id: <199607121704.TAA18867@keltia.freenix.fr>
Date: Fri, 12 Jul 1996 19:04:20 +0200 (MET DST)
From: Ollivier Robert <roberto@keltia.freenix.fr>
Reply-To: roberto@keltia.freenix.fr
To: FreeBSD-gnats-submit@freebsd.org
Subject: /bin/csh doesn't handle SIGWINCH correctly
X-Send-Pr-Version: 3.2

>Number:         1381
>Category:       bin
>Synopsis:       When one resizes an xterm window, $TERMCAP doesn't change
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 12 10:10:01 PDT 1996
>Closed-Date:    Sat Jul 13 11:06:22 MET DST 1996
>Last-Modified:  Sat Jul 13 02:10:03 PDT 1996
>Originator:     Ollivier Robert
>Release:        FreeBSD 2.2-CURRENT i386
>Organization:
Usenet Canal Historique
>Environment:

FreeBSD keltia.freenix.fr 2.2-CURRENT FreeBSD 2.2-CURRENT #14: Thu Jul 11 22:38:57 MET DST 1996     roberto@keltia.freenix.fr:/src/src/sys/compile/DKELTIA  i386

-r-xr-xr-x  1 bin  bin  266240 Jul 12 01:49 /bin/csh*

CURRENT from 1996 07/11 14:00:01, ctm#2220 from cvs-cur.

>Description:

/bin/csh as   shipped in  2.2-CURRENT  (and   probably  2.1-STABLE and  the
forthcoming  2.1.5-RELEASE) doesn't   support or  is  bug  in its  SIGWINCH
handling. Windows size changes are not shown  in the environment, resulting
in problems with many programs.

The bug is present in  2.2-CURRENT (as shown) and  in 2.1-RELEASE (as shown
to me by a friend of mine). 

>How-To-Repeat:

Here is an xterm, 80x24 wide and the shell used is /bin/csh.

TERMCAP=xterm|vs100|xterm terminal emulator (X window system):li#24:hs:ts=\E[?E\E[?%i%dT:fs=\E[?F:es:ds=\E[?E:is=\E>\E[?1;3;4;5l\E[?7;8h\E[1;65r\E[65;1H:rs=\E>\E[?1;3;4;5l\E[?7;8h:@7=\E[4~:kh=\E[1~:kI=\E[2~:k0=\E[10~:kD=\E[3~:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:kP=\E[5~:kN=\E[6~:K1=\EOw:K2=\EOy:K3=\EOu:K4=\EOq:K5=\EOs:al=\E[L:dl=\E[M:im=\E[4h:ei=\E[4l:mi:dc=\E[P:AL=\E[%dL:DL=\E[%dM:DC=\E[%dP:do=\E[B:cl=\E[H\E[J:sf=\ED:as=\E(0:ae=\E(B:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:nw=\EE:ce=\E[K:cd=\E[J:so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:sr=\EM:sc=\E7:rc=\E8:cs=\E[%i%d;%dr:UP=\E[%dA:DO=\E[%dB:RI=\E[%dC:LE=\E[%dD:ct=\E[3g:st=\EH:co#80:le=^H:bs:am:if=/usr/share/tabset/vt100:ac=llmmkkjjuuttvvwwqqxxnnpprr``aa:ks=\E[?1h\E=:ke=\E[?1l\E>:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=\177:ho=\E[H:pt:vt#3:xn:ta=^I:ms:bl=^G:cr=^M:eo:it#8:ut:

Note  li#24 and co#80.   Resize the window to something   else. I choose to
change it to 50x42. 

After doing it, the environment is

TERMCAP=xterm|vs100|xterm terminal emulator (X window system):li#24:hs:ts=\E[?E\E[?%i%dT:fs=\E[?F:es:ds=\E[?E:is=\E>\E[?1;3;4;5l\E[?7;8h\E[1;65r\E[65;1H:rs=\E>\E[?1;3;4;5l\E[?7;8h:@7=\E[4~:kh=\E[1~:kI=\E[2~:k0=\E[10~:kD=\E[3~:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:kP=\E[5~:kN=\E[6~:K1=\EOw:K2=\EOy:K3=\EOu:K4=\EOq:K5=\EOs:al=\E[L:dl=\E[M:im=\E[4h:ei=\E[4l:mi:dc=\E[P:AL=\E[%dL:DL=\E[%dM:DC=\E[%dP:do=\E[B:cl=\E[H\E[J:sf=\ED:as=\E(0:ae=\E(B:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:nw=\EE:ce=\E[K:cd=\E[J:so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:sr=\EM:sc=\E7:rc=\E8:cs=\E[%i%d;%dr:UP=\E[%dA:DO=\E[%dB:RI=\E[%dC:LE=\E[%dD:ct=\E[3g:st=\EH:co#80:le=^H:bs:am:if=/usr/share/tabset/vt100:ac=llmmkkjjuuttvvwwqqxxnnpprr``aa:ks=\E[?1h\E=:ke=\E[?1l\E>:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=\177:ho=\E[H:pt:vt#3:xn:ta=^I:ms:bl=^G:cr=^M:eo:it#8:ut:

Note that neither li# nor co# has changed.

>Fix:
	
Unknown, maybe borrow  code from tcsh   which handle this rightly.  This is
probably the   reason why many   people will never  see  the bug, not being
foolish enough to use pure csh :-)


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: joerg 
State-Changed-When: Sat Jul 13 11:06:22 MET DST 1996 
State-Changed-Why:  
This is a no-bug.  The shell is not supposed to modify its environment. 
The intended way for programs to learn about this is the strct 
winsize. 
The entire winsize idea is a bit weird though. 


From: J Wunsch <j@uriah.heep.sax.de>
To: roberto@keltia.freenix.fr
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/1381: /bin/csh doesn't handle SIGWINCH correctly
Date: Sat, 13 Jul 1996 09:24:11 +0200 (MET DST)

 As Ollivier Robert wrote:
 
 > /bin/csh as   shipped in  2.2-CURRENT  (and   probably  2.1-STABLE and  the
 > forthcoming  2.1.5-RELEASE) doesn't   support or  is  bug  in its  SIGWINCH
 > handling. Windows size changes are not shown  in the environment, resulting
 > in problems with many programs.
 
 This is a non-bug.  Shells are not supposed to intercept SIGWINCH for
 the purpose of fiddling with incorrect TERMCAP values.  (Heck, the
 TERMCAP entry in the environment is even a rather useless invention.)
 li# and co# in the TERMCAP are a design error for terminals that can
 handle more than one size (i.e., for everything more recent than a
 VT100 or ADM3A).
 
 The correct way for programs to handle this is to examine the struct
 winsize, which is correctly updated, at least for cases like xterm or
 vty's.
 
 Of course, struct winsize is a design error. :-)  It doesn't get
 notified when you turn your VT220 into 132-column mode manually.
 
 The entire tty capabilities' handling is a design error. :-))  Read
 the ``UNIX haters handbook'' for a more detailed explanation.
 
 -- 
 cheers, J"org
 
 joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)
>Unformatted:

