[net.general] vt220 termcap and .randrc

sloane@noscvax.UUCP (05/04/84)

This document describes the setup for a vt220 to work with the enclosed
termcap on 4.2bsd UN*X. The vt220 is operated as a vt100 except when 
the extra function keys are needed. The reason for operating in vt100 
mode is that in vt220 mode the ESC, BS, and LF keys are not operational. 
If desired the termcap could be modified to use the left arrow as a 
backspace key (:kb=\E[D:) and then run in vt220 mode, but it's nice 
to be able to use the ESC key when required. 

If you are a RAND editor user and if you choose to use the vt220 in native
vt220 mode, the .randrc file provided will have to be modified to not 
reset the vt220 to vt100 mode after the edit session is ended. 
(More about the .randrc later).

-------------------------------------------------------------------------
SETTING UP THE TERMINAL:

Setup the vt220 as follows using the set-up menus on the terminal:

        DISPLAY:        80 columns
                        Interpret Controls
                        Auto Wrap
                        Cursor (gotta see it)

        GENERAL:        VT100 mode
                        VT100 ASCII
                        User Defined Keys Unlocked
                        User Defined Features Unlocked
                        Numeric Keypad
                        Normal Cursor Keys
                        No New Line

          COMM:         7-bit EVEN PARITY (this is a must)

      KEYBOARD:         Auto Repeat
                        Break
                        No Answerback

These options are required - the ones not listed are up to the user's
discretion.

-------------------------------------------------------------------------
SETTING UP THE TERMCAP:

Now the termcap (one entry per line to make it easier to understand):

#DEC vt220 TERMCAP for terminal operating in 7-bit vt100 mode
#The terminal must use EVEN parity
#Contributed by Gary Sloane (sloane@nosc) MAY 1984
dv|vt220|DEC vt220 7 bit even parity vt100 mode with automargins autowrap:\
        :ae=4\E(B:\
        :am:\
        :as=2\E(<:\
        :bs:\
        :cd=50\E[J:\
        :ce=3\E[K:\
        :cl=50\E[H\E[2J:\
        :cm=10\E[%i%d;%dH:\
        :co#80:\
        :cr=^M:\
        :cs=\E[%i%d;%dr:\
        :dc=1\E[P:\
        :dl=1\E[M:\
        :do=^J:\
        :ei=\E[4l:\
        :ho=\E[H:\
        :if=/usr/lib/tabset/vt131:\
        :im=\E[4h:\
        :is=\E[1;24r\E[H\E[2J:\
        :k0=\E[1~:\
        :k1=\E[2~:\
        :k2=\E[3~:\
        :k3=\E[4~:\
        :k4=\E[5~:\
        :k5=\E[6~:\
        :k6=\EOP:\
        :k7=\EOQ:\
        :k8=\EOR:\
        :k9=\EOS:\
        :kb=^H:\
        :kd=\EOB:\
        :ke=\E[?1l\E>:\
        :kl=\EOD:\
        :kr=\EOC:\
        :ks=\E[?1h\E=:\
        :ku=\EOA:\
        :le=^H:\
        :li#24:\
        :nd=2\E[C:\
        :nl=^J:\
        :pt:\
        :rc=\E8:\
        :rf=/usr/lib/tabset/vt100:\
        :rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:\
        :sc=\E7:\
        :se=2\E[m:\
        :so=2\E[7m:\
        :sr=5\EM:\
        :ta=^I:\
        :ue=2\E[m:\
        :up=2\E[A:\
        :us=2\E[4m:\
        :vt#3:\
        :xn:

The termcap sets up the vt220 as a vt100 with automatic margins, and
assumes that the terminal is setup (as described above).

----------------------------------------------------------------------------
SETTING UP THE RAND EDITOR STARTUP FILE (RAND editor users only):

The following .randrc file allows the vt220 to be used as a suitable
workstation for the RAND editor. The keystrokes are set up to look
like WORDSTAR with the exception of the CTRL-Q sequences. The vt220
operates as a *true* vt220 while in a RAND session, with the terminal
being switched back to vt100 mode at exit. The reason for running in
vt220 mode is that all the function keys are available, while in vt100
mode they are not. Since the vt220 plays games with CTRL-Q (x-on) it
is necessary to map all RAND sequences to function keys if you want them
to work. The CTRL-Q/CTRL-S keyins do what they should - start and stop
the screen display. By looking at the .randrc you should be able to see
what keys are mapped to what RAND functions. If you are not used to
using a .randrc to make the editor look like WORDSTAR, then you probably
won't want this .randrc. Here goes:

dv vt220  VT220 
instring = \[[62;1"p\[>\[[?3l\[[?4l\[[?5l\[[?7l\[[?8h
end string = \[[61"p\[>\[[?7h
auto margin = 3