From: fred@poly2.nist.gov (Frederick R. Phelan Jr.)
Newsgroups: comp.sys.sgi
Subject: vt100 emulation
Date: 16 Apr 92 16:28:15 GMT


I wrote:
> Somebody sent me a script a while back that uses xterm to 
> emulate a vt100 ... works very well.  Mail if interested.
> 
> Fred Phelan
> fred@poly2.nist.gov
> 
> 

I have several requests for the vt100 script so I will
just post the info.  There are 2 files included below,
the first is the script that makes use of xterm, call
this file vt100.  The second is a readme file, it has
some explanatory information and some stuff you need to
add to your .Xdefaults file. 

---------------------Cut Here: vt100 script---------------------
#! /bin/sh
T="vt100 terminal"
if test $# -gt 0
then
        case $1 in
        -*)     ;;
        *)
                if test x"`nslookup $1 2>&1 1>/dev/null | \
                           grep 'Non-existent domain'`" != x
                then
                        E=""
                else
                        E="$1"
                        T="$1 $T"
                        shift
                fi
        esac
fi
if test x$E != x
then
        /usr/bin/X11/xterm -132 -sb -sk -tn vt100 -fn 9x15bold\
                -T "$T" -fg black -bg wheat -ms red -cr black -s -j $* \
                -e sh -c "exec telnet $E" &
else
        /usr/bin/X11/xterm -132 -sb -sk -tn vt100 -fn 9x15bold\
                -T "$T" -fg black -bg wheat -ms red -cr black -s -j $* &
fi
---------------------End of vt100 Script--------------

------------Cut Here: vt100 readme file----------------
To use this emulation type following :

        % vt100

        OR

        % vt100 node_name

This will do following emulation :

----------------------------------------------------
   SGI Key              |   Emulated VT100 key
----------------------------------------------------
  Num Lock              |   PF1
    /                   |   PF2
    *                   |   PF3
    -                   |   PF4
    7                   |   7
    8                   |   8
    9                   |   9
    +                   |   -
    4                   |   4
    5                   |   5
    6                   |   6
    1                   |   1
    2                   |   2
    3                   |   3
  Enter                 |   Enter
    0                   |   0
    .                   |   .
  Insert                |   Find
  Home                  |   Insert Here
  Page Up               |   Remove
  Delete                |   Select
  End                   |   Prev Screen
  Page Down             |   Next Screen
    F1                  |   F6
    F2                  |   F7
    F3                  |   F8
    F4                  |   F9
    F5                  |   F10
    F6                  |   F11
    F7                  |   F12
    F8                  |   F13
    F9                  |   F14
    F10                 |   Help
    F11                 |   Do
    F12                 |   F17
  Print Screen          |   F18
  Scroll Lock           |   F19
  Pause                 |   F20


To use this script, add the following to your .Xdefaults file:

-- Begin New for .Xdefaults  -------------------------------

XTerm*VT100.Translations: #override \
        <Key>BackSpace:         string(0x7f) \n\
        <Key>Num_Lock:          string(0x1b) string("OP") \n\
        <Key>KP_Divide:         string(0x1b) string("OQ") \n\
        <Key>KP_Multiply:       string(0x1b) string("OR") \n\
        <Key>KP_Subtract:       string(0x1b) string("OS") \n\
        <Key>KP_Add:            string(0x1b) string("Om") \n\
        <Key>Pause:             string(0x1b) string("[34~") \n\
        <Key>Print:             string(0x1b) string("[32~") \n\
        <Key>Scroll_Lock:       string(0x1b) string("[33~") \n\
        <Key>KP_0:              string(0x1b) string("Op") \n\
        <Key>KP_1:              string(0x1b) string("Oq") \n\
        <Key>KP_2:              string(0x1b) string("Or") \n\
        <Key>KP_3:              string(0x1b) string("Os") \n\
        <Key>KP_4:              string(0x1b) string("Ot") \n\
        <Key>KP_5:              string(0x1b) string("Ou") \n\
        <Key>KP_6:              string(0x1b) string("Ov") \n\
        <Key>KP_7:              string(0x1b) string("Ow") \n\
        <Key>KP_8:              string(0x1b) string("Ox") \n\
        <Key>KP_9:              string(0x1b) string("Oy") \n\
        <Key>KP_Decimal:        string(0x1b) string("On") \n\
        <Key>Insert:            string(0x1b) string("[1~") \n\
        <Key>Home:              string(0x1b) string("[2~") \n\
        <Key>Prior:             string(0x1b) string("[3~") \n\
        <Key>Delete:            string(0x1b) string("[4~") \n\
        <Key>End:               string(0x1b) string("[5~") \n\
        <Key>Next:              string(0x1b) string("[6~") \n\
        <Key>F1:                string(0x1b) string("[17~") \n\
        <Key>F2:                string(0x1b) string("[18~") \n\
        <Key>F3:                string(0x1b) string("[19~") \n\
        <Key>F4:                string(0x1b) string("[20~") \n\
        <Key>F5:                string(0x1b) string("[21~") \n\
        <Key>F6:                string(0x1b) string("[23~") \n\
        <Key>F7:                string(0x1b) string("[24~") \n\
        <Key>F8:                string(0x1b) string("[25~") \n\
        <Key>F9:                string(0x1b) string("[26~") \n\
        <Key>F10:               string(0x1b) string("[28~") \n\
        <Key>F11:               string(0x1b) string("[29~") \n\
        <Key>F12:               string(0x1b) string("[31~") \n\


-- End new for .Xdefaults ----------------------------------

---------------------End of vt100 readme file--------------



Thanks are actually due to Hemant Shah and David Cox through
who I received this originally.
---
Fred Phelan
fred@poly2.nist.gov