Dumb terminal screenlength problem

jimc at math.ucla.edu jimc at math.ucla.edu
Tue Dec 20 11:37:22 AEST 1988


zeke at sunfun.eta.com (Robert K. Scott) writes:
>Access for VT100 or H19 style terminal emulation on PCs is through a
>...TELNET session on the SUN.  The problem for these users is
>strange: sometimes their session thinks that they have more than 24 lines
>per screen...

That's not a bug, that's a feature!  Suppose a workstation user starts
suntools, and it uses a pseudo-tty for a shelltool (size 34x80).  Or he
does rlogin to a server from the shellltool or the big screen, getting a
ptty on the server.  He starts a background job with that ptty as its
official tty.  He exits.  Some poor student attaches via CS-1/Telnet and
gets the same ptty.  It's still set the way the last guy left it, because
his background job is still "using" the ptty.

The workaround is to do 
    if ("$TERM" == "network") stty rows 0 columns 0 9600
in each user's .login (or in the system default login script which you set
up after suffering through enough of this kind of stuff; tell all the
users to source it in their own .login on pain of ...)  It assumes that on
a Telnet from the CS-1 or otherwise when the incoming terminal type is
unknown, telnetd gives you a terminal type of "network" -- some people
hack their telnetd for other values.  It's important not to do this when a
real terminal type is known, as from rlogin or from a smart user-telnet,
as the user may be doing rlogin from a Suntools window and you do want the
originating window size to propagate.  The "9600" catches a similar
screwup from dial lines; pttys end up at 300 or 1200 baud and vi only uses
part of the screen.  Note that there is a bug in stty such that if you do
just "rows" it trashes the "columns" setting, so you have to do both.

[[ But doesn't that ruin the settings if you really do log in from a
(non-standard sized) Sun window?  --wnl ]]

James F. Carter        (213) 825-2897
UCLA-Mathnet;  6608B MSA; 405 Hilgard Ave.; Los Angeles, CA  90024-1555
UUCP:...!{rutgers,ucbvax,sdcrdcf,{hao!cepu}}!ucla-cs!math.ucla.edu!jimc
ARPA: jimc at math.ucla.edu            BITNET: jimc%math.ucla.edu at INTERBIT



More information about the Comp.sys.sun mailing list