[comp.sys.next] Stuart/termcap interactions

scott@texnext.gac.edu (Scott Hess) (03/19/91)

Since I've been getting lots of mail on this topic (something like
a message or two per day this week :-), I've decided to write up
the problem and submit it to the net.  This will be my reply to
future mail messages, so don't expect much more out of me . . . if
anyone notes glaring misconceptions or the like, drop me a line.

[I post to the net because this might also be affecting others with
 other terminals/emulators.]

Later,
scott

Problem (it's not a bug):

Stuart does not apparently correctly handle windows larger than 24
lines.

Reason:

The termcap file on the NeXT has been changed to the latest BSD
reno termcap.  The sequence is now reads something like 'is=\E[1;24r'.
This sequence is sent early and often by the subshell, and basically
tells Stuart to set the scrolling region to lines 1-24, ignoring
the rest.

Solution:

Change the entry back.  The sequence '\E[r' is exactly equivalent
to '\E[1;24' for all 24-line vt100s.  I'm not at all sure why the
change was made in the first place - apparently with intent to make
terminal emulators out there "appear" to break.

There are two ways in which this fix could be applied.  One would
be to edit the global /etc/termcap file.  I think this is the best
solution, because it is only a positive effect.  Another method
which can be applied by mortal users would be to copy out the
section of the file related to vt100 (right there at the top of
the file), change the affected sequence, and then place it somewhere
in your personal directory (I like ~/.termcap).  Then, 'dwrite
Stuart Termcap ~/.termcap', or add a line 'setenv TERMCAP ~/.termcap'
to your .cshrc.

Future:

I've had requests to add a hack to Stuart to "fix" this problem.
Apparently someone at NeXT added such a hack to Terminal - I'm not
sure.  The problem is that such a hack is non-trivial in its effect
on the subshell environment.  Simply watching for '\E[1;24r' can
have adverse effects on elaborate programs such as emacs.  In fact,
the only programs it would be fully safe for would be command-line
shells.  That's the only reason I'm really even considering the
hack - most people spent lots of time in their shells.

This hack will be a preferences option, just in case.

Another possibility is that I'll plan to support more of the xterm
entry.  In that case, the terminal type can be changed to xterm,
which is correct ('is=\E[r...' starts that sequence).  This would
solve the problem entirely, without unsightly hacks.
--
scott hess                      scott@gac.edu
Independent NeXT Developer	GAC Undergrad
<I still speak for nobody>
"Tried anarchy, once.  Found it had too many constraints . . ."
"I smoke the nose Lucifer . . . Banana, banana."

rca@cs.brown.edu (Ronald C.F. Antony) (03/20/91)

In article <SCOTT.91Mar18135128@texnext.gac.edu> scott@texnext.gac.edu (Scott Hess) writes:
>Solution:
>Change the entry back.  The sequence '\E[r' is exactly equivalent
>to '\E[1;24' for all 24-line vt100s.  I'm not at all sure why the
>change was made in the first place - apparently with intent to make
>terminal emulators out there "appear" to break.
>[...]
>Another possibility is that I'll plan to support more of the xterm
>entry.  In that case, the terminal type can be changed to xterm,
>which is correct ('is=\E[r...' starts that sequence).  This would
>solve the problem entirely, without unsightly hacks.

In the mean time, why don't we copy the vt100 entry, change the copy's
name to stuart, and set term=stuart ?
This should also be a clean approach to the problem...

Ronald

------------------------------------------------------------------------------
"The reasonable man adapts himself to the world; the unreasonable one persists
in trying to adapt the world to himself. Therefore all progress depends on the
unreasonable man."   G.B. Shaw   |  rca@cs.brown.edu or antony@browncog.bitnet

dennis@cpac.washington.edu (Dennis Gentry) (03/20/91)

In article <69159@brunix.UUCP> rca@cs.brown.edu (Ronald C.F. Antony) writes:

   In the mean time, why don't we copy the vt100 entry, change the copy's
   name to stuart, and set term=stuart ?
   This should also be a clean approach to the problem...

Probably the best way to do that is to add this termcap entry
(preferably in /etc/termcap, but the ~/.termcap thing Scott
suggested would be OK too):

sr|stuart|Stuart or 2.0 Terminal on NeXT:\
        :is=\E[r:tc=vt100:


Dennis