[comp.sys.sun] Incorrect screen size on login - SunOS 4.1

harry@atmos.washington.edu (Harry Edmon) (07/10/90)

When I log into a Sun 4/370 via a modem on my Wyse 75, the number of rows
on the screen shown via "stty -a" is often incorrect.  The number seems to
be random and always larger that the actual screen.  Using "stty rows 23"
after logging in corrects the problem.  Has anyone else seen this?

Harry Edmon		INTERNET: harry@atmos.washington.edu
(206) 543-0547		UUCP:	  uw-beaver!atmos.washington.edu!harry
Dept of Atmospheric Sciences, AK-40
University of Washington

jimc@math.ucla.edu (Jim Carter) (07/17/90)

In article <9771@brazos.Rice.edu> harry@atmos.washington.edu (Harry Edmon) writes:
>
>When I log into a Sun 4/370 via a modem on my Wyse 75, the number of rows
>on the screen shown via "stty -a" is often incorrect.  The number seems to
>be random and always larger that the actual screen.  Using "stty rows 23"
>after logging in corrects the problem.  Has anyone else seen this?

You also see this on pttys (rlogin or telnet).  A related problem is that
when you do "vi" only part of the screen is used, as if you were on a 300
baud or 1200 baud dial line.  The number of rows and columns, and the baud
rate, are not cleared until all processes exit that have the tty open,
including background processes for which that tty is the controlling tty
-- a common occurrence.  In our generic .login we simply put 

  if (! $?TERM) setenv TERM unknown
  switch ($TERM)
    case unknown:
    case su:
    case network:
        stty new crt tostop erase ^H kill ^U rows 0 columns 0 9600
        breaksw
    case dialup:
        stty new crt tostop erase ^H kill ^U rows 0 columns 0
        breaksw
    default:
        stty new crt tostop erase ^H kill ^U
  endsw

(Note that both rows and columns must be set, due to a bug.)  Thus on a
dialup or telnet from a terminal server, the user gets a clean slate,
while on rlogin when a real terminal type is known, the screen dimensions
and passed-through baud rate are not disturbed.

James F. Carter        (213) 825-2897
UCLA-Mathnet;  6221 MSA; 405 Hilgard Ave.; Los Angeles, CA, USA  90024-1555
Internet: jimc@math.ucla.edu            BITNET: jimc%math.ucla.edu@INTERBIT
UUCP:..!{ucsd,ames,ncar,gatech,purdue,rutgers,decvax,uunet}!math.ucla.edu!jimc