http://invisible-island.net/xterm/
Copyright © 1997-2011,2012 by Thomas E. Dickey
Here is the latest version of this file.

Contents

    Mini-XTerm Icon     XTerm Icon

What is XTerm?

From the manual page:

The xterm program is a terminal emulator for the X Window System. It provides DEC VT102/VT220 and selected features from higher-level terminals such as VT320/VT420/VT520 (VTxxx). It also provides Tektronix 4014 emulation for programs that cannot use the window system directly. If the underlying operating system supports terminal resizing capabilities (for example, the SIGWINCH signal in systems derived from 4.3bsd), xterm will use the facilities to notify programs running in the window whenever it is resized.

That is, xterm (pronounced "eks-xterm") is a specific program, not a generic item. It is the standard X terminal emulator program.

This FAQ presents various useful bits of information for both the specific program as well as other programs that imitate it.

Who wrote XTerm?

I've been working on xterm since early 1996 (see my changelog for details).

But the program is much older than that.

A lot of people, cited at the bottom of the manual page wrote the original xterm program, maintained by the X Consortium (later part of the Open Group – I'm well aware of the distinction, but am citing when the work was done, not who the current owner may be). There is no changelog, and it is not clear who did what. Email from Jim Gettys provides some background:

Cast of thousands...

To give a bit of history, xterm predates X!

It was originally written as a stand-alone terminal emulator for the VS100 by Mark Vandevoorde, as my coop student the summer that X started.

Part way through the summer, it became clear that X was more useful than trying to do a stand alone program, so I had him retarget it to X. Part of why xterm's internals are so horrifying is that it was originally intended that a single process be able to drive multiple VS100 displays. Don't hold this against Mark; it isn't his fault.

I then did a lot of hacking on it, and merged several improved versions from others back in.

Notable improvements include the proper ANSI parser, that Bob McNamara did.

The Tek 4010 support came from a guy at Smithsonian Astrophysical Observatory whose name slips my mind at the moment.

Ported to X11 by Loretta Guarino.

Then hacked on at the X Consortium by uncounted people.

Email from Doug Mink provides more background:

I was checking out the newly revised AltaVista search engine to see what was on the net about xterm, and I found your pages. I can add to the FAQ in that I was the "guy at the Smithsonian Astrophysical Observatory" Jim Gettys refers to. I am listed at the end of the man page under authors. What happened was that I was hired by SAO (after leaving the research staff at MIT) in October 1985 to write analysis software for the Spacelab 2 Infrared Telescope which was to fly on the Space Shuttle in 1985 less than six months after I was hired. I came with a tar tape full of software I had written for Unix and Tektronix terminals, but I was presented with a VS100 terminal which had an early version (X6 or so) of xterm, with no graphics capabilities. SAO is at Harvard, across Cambridge from MIT, where Jim Gettys was detailed from DEC to the X project, and Jim had connections with SAO, having worked here after college (MIT, where we had both worked at the observatory at various times); he was still sharing an apartment with an SAO colleague of mine, too. Anyway, everyone decided that since I knew Tektronix commands pretty well, and our group desparately needed the graphics capabilities, it would be a good use of my time to implement a Tektronix terminal emulator under X. So I set to work learning more C--I had only written a couple of wrappers to C I/O routines so I could use them with my Fortran software--and wrote a Tektronix emulator. The only X documentation at the time was the code itself. While I was at it, I wrote an improved Tektronix emulator for our Imagen laser printer which used the full resolution of that 300 dpi printer instead of the effective 100 dpi (i.e. jaggy) emultator distributed with the printer. The original xterm Tek emulator shared a window with the VT100 emulator, much like on the VT240 terminals which I had been using at MIT before I came to Harvard. With a VAX 750 running several VS100's, window creation was sloowww, so sharing a window was the quickest way to do things, and all of my software was written for that mode of operation, anyway. While I wrote the emulator so that my software would work on it, it was tested by the X group against a BBN graphics package, the name of which slips my mind right now.

Anyway, 15 years later, I am still using xterm and some of the same mapping software I wrote the emulator for. And I am still at the Smithsonian Astrophysical Observatory.

This FAQ is oriented toward the version of xterm originally distributed with XFree86 (more commonly known as modern, or "new xterm", with a corresponding terminal description "xterm-new"), which was based on the X11R6.3 xterm, with the addition of ANSI color and VT220 controls.

What is a VT220?

Why a VT220?

The manual page mentions a VT220. Most terminal emulators documentation talk about VT100. But a VT100 is a rather limited subset of what people expect:

Initially, I was only interested in making colors workable for curses programs.

Later, I noticed that xterm had some support for what would now be termed as ISO-2022. That was a VT220 feature, rather than VT100. There were some missing pieces. So I decided to fill in those pieces and make xterm a VT220 emulator. (VT220s do not do ANSI color either—the missing pieces were in other areas).

XTerm also provides features that are in neither VT100 nor VT220, which are used by other programs as "xterm emulation".

By the way, the control string used for setting the titles was not in a standard format:

I revised that area starting in 1996,

What is a State Table?

That was mentioned regarding the title strings. XTerm uses a state machine to handle incoming characters. That is essentially what a real terminal does. Other "xterm" terminal emulators typically do not do this, which makes them not do well with vttest.

What platforms does it run on?

XTerm runs in all of the implementations of X11. I've built and run these since I started working on xterm:

The older configurations have X11R5 libraries. Only minor changes are needed to make xterm work on those systems. However, with X11R6 you can obtain better locale support, as well as new features such as the active icon. X11R7... not much to say there.

What is the latest version?

The most recent (and well supported) version of xterm is the one that I maintain:

What versions are available?

There are several other versions of xterm, based on xterm's source. These include

There are similar programs not based on xterm's source, which are compatible to different degrees. These include

Some of these use the VTE widget. Since that supplies most of the terminal emulation, the remaining differences between programs using VTE tend to be at the level of the window manager (menus, borders, etc.). Other (older) programs which are based on reusable widgets include dtterm and emu.

(I am aware of a few others, such as xcterm, but have not seen a working version of these).

Finally of course, there are a multitude of programs which set TERM to "xterm", in the hope that applications will treat them the same as xterm. For example, PuTTY does this. But its wrapping behavior is incompatible with xterm (and any vt100 emulator). You can see this in the first menu entry for vttest.

Each of the programs noted here which are well-established and which are known to differ markedly from xterm have their own terminal descriptions in ncurses, to which TERM should be set. Otherwise, bug-reports are misdirected to ncurses which should have been addressed by the respective developers of these programs. ncurses. These include

Comparing versions, by counting controls

Several of these programs are claimed (either by their developers, or their users) to emulate "most" of xterm. To me, "most" would be something quantifiable, e.g., 80 percent. To satisfy my curiousity, I wrote a script to extract the control sequence information from ctlseqs.txt. This counts each control sequence, as well as the variations such as setting bold, color, inverse video. Then I (laboriously) inspected these terminal implementations:

As of mid-November 2010, these are the latest implementations. I included data for the vt220 and vt102 to be able to contrast the various terminal emulators against those as well as xterm. There are:

For each control, there are three possibilities:

  1. "yes" — the terminal implements it, matching xterm. If xterm implements it, and it is a feature of vt220 or vt102, then in turn xterm's behavior must match vt220 or vt102.
  2. "partial" — the terminal implements it, but its behavior does not match the reference noted above.
  3. "no" — the terminal does not implement the control.

The control sequences document lists a few controls which xterm does not (completely) implement, e.g.,

None of the other terminal emulators implements those either.

Comparing against the control sequences document
yes partial no program
488 4 6 xterm-new
154 6 338 xterm-r6
188 5 305 vt220
104 0 394 vt102
204 3 291 rxvt
219 3 276 urxvt
191 2 305 putty
170 3 325 konsole
184 6 308 vte

Modern xterm implements 188 primary controls. In this table, konsole ranks last because it does not support vt52 emulation. This is not unusual, since the rxvt-based emulators do not, either. However, all vt100's provide this feature; programs lacking this are not really a vt100 emulator. On the other hand, PuTTY (which is not a vt100 emulator due to its incompatible wrapping behavior) supports this feature.

Aside from that, the various emulators implement much the same features from xterm. None implements as many as half of xterm's controls.

Comparing against xterm
yes partial no program
488 0 0 xterm-new
154 6 328 xterm-r6
182 2 304 vt220
98 0 390 vt102
204 3 281 rxvt
219 3 266 urxvt
189 2 297 putty
170 3 315 konsole
184 6 298 vte

DEC VT220 implements 96 primary controls. Modern xterm (as documented), implements most of the VT220. VTE implements fewer than half. The others are a little better. None of the others could be used as a real VT220.

Comparing against vt220
yes partial no program
182 0 6 xterm-new
78 6 104 xterm-r6
188 0 0 vt220
104 0 84 vt102
101 3 84 rxvt
106 3 79 urxvt
107 2 79 putty
100 3 85 konsole
88 6 94 vte

DEC VT102 (the actual flavor used for "vt100" in most cases), implements 68 primary controls. Again, VTE fares worst, and the others a little better.

Comparing against vt102
yes partial no program
98 0 6 xterm-new
70 6 28 xterm-r6
104 0 0 vt220
104 0 0 vt102
79 2 23 rxvt
81 2 21 urxvt
86 2 16 putty
85 3 16 konsole
60 1 43 vte

In summary, none of the other terminal emulators emulates "most" of xterm. Instead, they implement the most commonly-used control sequences, and there are differences between them.

How do I ...

Not really problems, but frequently asked questions (the point of this, after all):

How do I change the font size?

XTerm uses fonts given as resource settings. You can switch between these fonts at runtime, using a menu. This is documented in the manpage, in the MENUS section.

X Consortium xterm provides popup menus, by pressing the control key together with the mouse button. Control right mouse button pops up the VT FONTS menu, from which you can select fonts that are specified in xterm's resources. Usually these are in increasing order of size.

Modern xterm provides the menu, plus a feature adapted from rxvt: pressing the shifted keypad plus or minus keys steps through the font menu selections, in order of their size.

XTerm's manpage does not document the syntax for X resources; it is done in the X documentation. If you are instead asking about a problem displaying a given font, it may be due to a problem with your resource settings.

How do I print the screen?

That depends on why you want to print it.

If you want a trace of an interactive session, you should use the script program. It records every character sent to the screen, recording them in a file typescript. There are two drawbacks to this approach:

Well, what about logging? Some versions of xterm support logging to a file. In fact modern xterm does. Logging was dropped from X Consortium xterm during X11R5 due to security concerns. Those were addressed, but logging was not reinstated (in fact there is a related bug in xterm). Some people prefer this, because it is convenient: you can start and stop logging a popup menu entry. However

Both script and logging are useful for recording, but they require interpretation to make sense of the trace. You probably would not send that trace to a printer (not twice, anyway).

If you want to print the contents of the screen, modern xterm implements, as part of the VT100 emulation, an "attached" printer.

There are limitations and tradeoffs using the "attached" printer, because it is an emulation:

If you use the popup menu to print the screen, this will close the printer pipe unless it was already opened by the application running in xterm.

How do I set up function keys?

With modern xterm, this is relatively simple. So I'll answer that first.

With X Consortium xterm, you had partial support for DEC VTxxx function keys. Function keys F1 to F12 correspond to DEC's F1 to F12 (sort of). Actually, DEC's VT220 terminals do not have codes for F1 through F5. They are reserved for local functions. And the VT220 (and up) terminals have 20 function keys. So you cannot do anything with the F13 through F20 (i.e., DO, HELP and SELECT). Finally, though xterm is reputed to be VT100-compatible, it has no support for the VT100 keypad (PF1 to PF4, and the "," key).

Modern (XFree86) xterm changed the X Consortium codes for F1 to F4 to match the VT100 PF1 to PF4, except when the emulation level is VT220 and up. In this case, it generates the same F1 to F4 codes as X Consortium xterm. Moreover, it adds a new resource sunKeyboard, which tells the program whether it has only 12 function keys (i.e., a Sun or PC keyboard). If so (this is selectable from the popup menu), you can use the control key with F1 to F12 to get F13 to F24, and use the "+" key on the keypad as an alias for "," (comma).

The emulation level for modern xterm is set via the resource decTerminalID, e.g., to 220 for a VT220. Once set, applications can set the emulation level up or down within that limit. DEC's terminals are configured in much the same way by a setup option.

That is the simple way, using a couple of new resources. The traditional way to get function keys involves translations. I have seen a few postings on the newsgroups that do this. Here is one from Bruce Momjian <root@candle.pha.pa.us> for a VT220:

        xterm $XTERMFLAGS +rw +sb +ls $@ -tm 'erase ^? intr ^c' \
                -name vt220 -title vt220 -tn xterm-220 "$@" &

with the corresponding resources:

        XTerm*VT100.translations: #override \n\
                
<Key>Home: string(0x1b) string("[3~") \n \
                
<Key>End: string(0x1b) string("[4~") \n
        vt220*VT100.translations: #override \n\
        ~Shift  
<Key>F1: string(0x1b) string("OP") \n \
        ~Shift  
<Key>F2: string(0x1b) string("OQ") \n \
        ~Shift  
<Key>F3: string(0x1b) string("OR") \n \
        ~Shift  
<Key>F4: string(0x1b) string("OS") \n \
        ~Shift  
<Key>F5: string(0x1b) string("[16~") \n \
        ~Shift  
<Key>F6: string(0x1b) string("[17~") \n \
        ~Shift  
<Key>F7: string(0x1b) string("[18~") \n \
        ~Shift  
<Key>F8: string(0x1b) string("[19~") \n \
        ~Shift  
<Key>F9: string(0x1b) string("[20~") \n \
        ~Shift  
<Key>F10: string(0x1b) string("[21~") \n \
        ~Shift  
<Key>F11: string(0x1b) string("[28~") \n \
        ~Shift  
<Key>F12: string(0x1b) string("[29~") \n \
        Shift   
<Key>F1: string(0x1b) string("[23~") \n \
        Shift   
<Key>F2: string(0x1b) string("[24~") \n \
        Shift   
<Key>F3: string(0x1b) string("[25~") \n \
        Shift   
<Key>F4: string(0x1b) string("[26~") \n \
        Shift   
<Key>F5: string(0x1b) string("[K~") \n \
        Shift   
<Key>F6: string(0x1b) string("[31~") \n \
        Shift   
<Key>F7: string(0x1b) string("[31~") \n \
        Shift   
<Key>F8: string(0x1b) string("[32~") \n \
        Shift   
<Key>F9: string(0x1b) string("[33~") \n \
        Shift   
<Key>F10: string(0x1b) string("[34~") \n \
        Shift   
<Key>F11: string(0x1b) string("[28~") \n \
        Shift   
<Key>F12: string(0x1b) string("[29~") \n \
                
<Key>Print: string(0x1b) string("[32~") \n\
                
<Key>Cancel: string(0x1b) string("[33~") \n\
                
<Key>Pause: string(0x1b) string("[34~") \n\
                
<Key>Insert: string(0x1b) string("[2~") \n\
                
<Key>Delete: string(0x1b) string("[3~") \n\
                
<Key>Home: string(0x1b) string("[1~") \n\
                
<Key>End: string(0x1b) string("[4~") \n\
                
<Key>Prior: string(0x1b) string("[5~") \n\
                
<Key>Next: string(0x1b) string("[6~") \n\
                
<Key>BackSpace: string(0x7f) \n\
                
<Key>Num_Lock: string(0x1b) string("OP") \n\
                
<Key>KP_Divide: string(0x1b) string("Ol") \n\
                
<Key>KP_Multiply: string(0x1b) string("Om") \n\
                
<Key>KP_Subtract: string(0x1b) string("OS") \n\
                
<Key>KP_Add: string(0x1b) string("OM") \n\
                
<Key>KP_Enter: string(0x1b) string("OM") \n\
                
<Key>KP_Decimal: string(0x1b) string("On") \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>Up: string(0x1b) string("[A") \n\
        !       <Key>Down: string(0x1b) string("[B") \n\
        !       <Key>Right: string(0x1b) string("[C") \n\
        !       <Key>Left: string(0x1b) string("[D") \n\
 
        *visualBell:    true
        *saveLines:    1000
        *cursesemul:    true
        *scrollKey: true
        *scrollBar: true

Note that real VT220 terminals use shifted function keys to mean something different: the user-programmable keys (i.e., DECUDK). Modern xterm supports this, but the translations do not (they're using shift to select F13 to F20).

Here's another one, from Robert Ess <ress@spd.dsccc.com>:

#!/bin/sh
 
#               vax
# 09-17-96      Bob Ess      - initial creation
# 09-26-96      Shig Katada  - Additional keybindings
#
#               Script file to incorporate keybindings and command line
#               options for connecting to a VAX node
 
# Usage statement
Usage(){
        echo
        echo " Usage  : vax -options"
        echo
        echo " Options: -80   for 80 column terminal"
        echo "          -132  for 132 column terminal"
        echo "          -fg colorname"
        echo "          -bg colorname"
        echo "          -fn fontname"
        echo "          -fb bold fontname"
        echo "          -host [altair] [devel] [leonis] [castor]"
        echo ""
        echo " Example: \"vax -80 -fg white -bg black -fn 9x15 -fb 9x15b -host castor\""
        echo "          Starts a VAX session with an 80 column terminal"
        echo "          with a black background, white foreground, a normal"
        echo "          font of 9x15 and a bold font of 9x15b, and connects"
        echo "          to the node 'castor'"
        echo
        echo "          If you need additional help, please call Workstation"
        echo "          Services at x92396."
        echo
        exit 1
}
 
# Default to a black foreground with a white background.
# Use the 9x15 and 9x15bold fonts. Connect to castor by default.
#
FG=black
BG=white
HOST=castor
FONT=9x15
BFONT=9x15bold
COLS=80
 
# Parse the command line arguments
#
while [ $# != 0 ];
do
        case $1 in
                -80)    COLS=80
                        FONT=spc12x24c
                        BFONT=spc12x24b
                        shift
                        ;;
                -132)   COLS=132
                        FONT=9x15
                        BFONT=9x15b
                        shift
                        ;;
                -fg)    shift
                        FG=$1
                        shift;;
                -bg)    shift
                        BG=$1
                        shift;;
                -fn)    shift
                        FONT=$1
                        shift;;
                -fb)    shift
                        BFONT=$1
                        shift;;
                -host)  shift
                        HOST=$1
                        shift;;
                -help)  Usage;;
                *)      Usage;;
        esac
done
 
xterm  -title "VAX" -sb -sl 1200 -geo ${COLS}x24 -fg ${FG} -bg ${BG} \
        -cr red -fn ${FONT} -fb ${BFONT} -xrm \
        'XTerm*VT100.translations:     #override \n\
        <Key>Insert:            string(\001) \n\
        Shift <Key>Up:          scroll-back(1,lines) \n\
        Shift <Key>Down:        scroll-forw(1,lines) \n\
        Shift <Key>Right:       string(0x1b) string("f") \n\
        Shift <Key>Left:        string(0x1b) string("b") \n\
        Shift <Key>Delete:      string(0x1b) string(0x08) \n\
        Shift <Key>Tab:         string(0x1b) string("*") \n\
        <Key>0x1000FF0D:        scroll-back(1,page) \n\
        <Key>0x1000FF0E:        scroll-forw(1,page) \n\
        <Key>0x1000FF09:        string(\010) \n\
        <Key>0x1000FF0A:        string(\005) \n\
        <Key>BackSpace:         string(0xff) \n\
        <Key>Select:            select-start() \n\
        <Key>0x1000FF02:        select-end(PRIMARY,CUT_BUFFER0) \n\
        Meta <Key>0x1000FF02:   select-end(CLIPBOARD) \n\
        <Key>0x1000FF04:        insert-selection(PRIMARY,CUT_BUFFER0) \n\
        Meta <Key>0x1000FF04:   insert-selection(CLIPBOARD) \n\
        <Key>F1:                string(0x1b) string("OP") \n\
        <Key>F2:                string(0x1b) string("OQ") \n\
        <Key>F3:                string(0x1b) string("OR") \n\
        <Key>F4:                string(0x1b) string("OS") \n\
        <Key>F5:                string(0x1b) string("OA") \n\
        <Key>F11:               string(0x1b) string("[23~") \n\
        <Key>F12:               string(0x1b) string("[24~") \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_Divide:         string(0x1b) string("OP") \n\
        <Key>KP_Multiply:       string(0x1b) string("[29~") \n\
        <Key>KP_Enter:          string(0x1b) string("OM") \n\
        <Key>KP_Subtract:       string(0x1b) string("Om") \n\
        <Key>KP_Add:            string(0x1b) string("Ol") \n\
        <Key>KP_Decimal:        string(0x1b) string("On") \n\
        <Btn1Down>:             select-start() \n\
        <Btn1Motion>:           select-extend() \n\
        <Btn1Up>:               select-end(PRIMARY,CUT_BUFFER0) \n\
        Button1<Btn2Down>:      select-end(CLIPBOARD) \n\
        Button1<Btn2Up>:        ignore()'
 \
        -e telnet $HOST &

Finally (for the moment) is a further modification of Robert Ess's script by Erik Ahlefeldt, <oahlefel@metz.une.edu.au>. From his readme file, for vmsterm:

This script is for people who wish to connect from a Linux or Unix computer to a VMS computer using telnet and get a good VT100 or VT220 emulation. The key mappings have been specifically designed to emulate the VT terminal auxiliary numeric keypad, so that you can use VMS EDT and TPU editors, as well as the many VMS applications use keys PF1 to PF4. The script should work with any recent version of Xterm using a standard extended IBM PC keyboard or a Sun keyboard.

About the keymappings. First the auxiliary numeric keypad. My prime objective with these mappings was to produce a setup that I could use with the EDT and TPU editors which make extensive use of the numeric keypad. The top row of keys PC numeric keypad (Num Lock, Divide, Multiply, Subtract) are where you find PF1, PF2, PF3, PF4 on a VT keyboard, so I have mapped them to PF1 thru PF4. The PC numeric keypad Add key (+) takes up the space of two keys which are Minus and Comma on the VT keyboard – I have mapped it to Comma (Delete Character in the EDT editor). I have then used the PC Pause key to map to VT key Minus (Delete Word in the EDT editor). The remaining keys on the auxiliary numeric keypad are the same for PC and VT.

The six keys between the main and numeric keypads on the PC (Insert, Home, Page Up, Delete End, Page Down) are usually mapped to the VT keys by either position or by (approximate) function. As I rarely use these keys I have mapped them by function as follows: PC key Insert to VT Insert Here, PC Home to VT Find, PC Page Up to VT Prev, PC Delete to VT Remove, PC End to VT Select, PC Page Down to VT Next.

Function keys.
There are 12 function keys on the PC keyboard and 20 on the VT keyboard, so I map PC F1 thru F12 to VT F1 thru F12 (except for F1 thru F5 as noted below) and PC Shift F1 thru Shift F10 to VT F11 thru F20.

The VT keys F1 thru F5 are local hardware function keys so there is nothing to emulate, however some PC to VT emulations in the past have mapped PF1 thru PF4 here, so I have done that too, even though they are already mapped on the auxiliary numeric keypad.

Xterm functionality.
You lose some xterm functions when you remap the keyboard, however this script implements a scroll back buffer of 1000 lines which you scroll through using Shift and Up (a.k.a. Up Arrow or Cursor Up key) or Shift and Down.

a summary of the keyboard mapping:

                PC Key     maps to   VT Key.
                ------               ------
                F1                   PF1
                F2                   PF2
                F3                   PF3
                F4                   PF4
                F5                   unused
                F6                   F6
                F7                   F7
                F8                   F8
                F9                   F9
                F10                  F10
                F11                  F11
                F12                  F12
                Shift F1             F11
                Shift F2             F12
                Shift F3             F13
                Shift F4             F14
                Shift F5             F15 (Help)
                Shift F6             F16 (Do)
                Shift F7             F17
                Shift F8             F18
                Shift F9             F19
                Shift F10            F20
                Shift F11            F11
                Shift F12            F12
                Print                Help (F15)
                Cancel               Do   (F16)
                Pause                Keypad Minus

                Insert               Insert Here
                Delete               Remove
                Home                 Find
                End                  Select
                Prior                Prev
                Next                 Next
                BackSpace            BackSpace (sends DEL - ascii 127)

                Num_Lock             PF1
                KP_Divide            PF2
                KP_Multiply          PF3
                KP_Subtract          PF4
                KP_Add               Keypad Comma
                KP_Enter             Enter
                KP_Decimal           Period
                KP_0                 Keypad 0
                KP_1                 Keypad 1
                KP_2                 Keypad 2
                KP_3                 Keypad 3
                KP_4                 Keypad 4
                KP_5                 Keypad 5
                KP_6                 Keypad 6
                KP_7                 Keypad 7
                KP_8                 Keypad 8
                KP_9                 Keypad 9
                Up                   Up
                Shift Up             Scroll Back
                Down                 Down
                Shift Down           Scroll Forward
                Right                Right
                Left                 Left

and the script:

#!/bin/sh
#               vmsterm
#               from an original script by Bob Ess
#               key translations by Erik Ahlefeldt
#
#               Script file using Xterm and telnet to connect to a VMS host
#               and give a decent vt220 emulation.
#
# Usage statement
Usage(){
        echo
        echo " Usage  : vmsterm -options"
        echo
        echo " Options: -80   for 80 column terminal"
        echo "          -132  for 132 column terminal"
        echo "          -bg colorname"
        echo "          -fg colorname"
        echo "          -fn fontname"
        echo "          -fb bold fontname"
        echo "          -host [crusher.saltmine.com] [earth] [192.168.7.7]"
        echo ""
        echo " Example: \"vmsterm -80 -fg white -bg black -fn 9x15 -fb 9x15b -host earth\""
        echo "          Starts a VMS session with an 80 column terminal"
        echo "          with a black background, white foreground, a normal"
        echo "          font of 9x15 and a bold font of 9x15b, and connects"
        echo "          to the node 'earth'"
        echo ""
        echo " Example: \"vmsterm -host earth\""
        echo "          Starts a VMS session with default terminal settings "
        echo ""
        echo " Example: \"vmsterm -help\""
        echo "          Displays vmsterm options "
        echo
        exit 1
}
 
# Default to a black foreground with a white background.
# Use the 9x15 and 9x15bold fonts. Connect to 192.168.3.3 by default.
#
FG=black
BG=white
HOST=192.168.3.3
FONT=9x15
BFONT=9x15bold
COLS=80
 
# Parse the command line arguments
#
while [ $# != 0 ];
do
        case $1 in
                -80)    COLS=80
                        FONT=spc12x24c
                        BFONT=spc12x24b
                        shift
                        ;;
                -132)   COLS=132
                        FONT=9x15
                        BFONT=9x15b
                        shift
                        ;;
                -fg)    shift
                        FG=$1
                        shift;;
                -bg)    shift
                        BG=$1
                        shift;;
                -fn)    shift
                        FONT=$1
                        shift;;
                -fb)    shift
                        BFONT=$1
                        shift;;
                -host)  shift
                        HOST=$1
                        shift;;
                -help)  Usage;;
                *)      Usage;;
        esac
done
 
xterm   -title "VMSTERM" -sb -sl 1000 -geo ${COLS}x24 -fg ${FG} -bg ${BG} \
        -cr blue -fn ${FONT} -fb ${BFONT} -xrm \
        'XTerm*VT100.translations: #override \n \
        ~Shift  <Key>F1:        string(0x1b)    string("OP") \n \
        ~Shift  <Key>F2:        string(0x1b)    string("OQ") \n \
        ~Shift  <Key>F3:        string(0x1b)    string("OR") \n \
        ~Shift  <Key>F4:        string(0x1b)    string("OS") \n \
        ~Shift  <Key>F5:        string("Break") \n \
        ~Shift  <Key>F6:        string(0x1b)    string("[17~") \n \
        ~Shift  <Key>F7:        string(0x1b)    string("[18~") \n \
        ~Shift  <Key>F8:        string(0x1b)    string("[19~") \n \
        ~Shift  <Key>F9:        string(0x1b)    string("[20~") \n \
        ~Shift  <Key>F10:       string(0x1b)    string("[21~") \n \
        ~Shift  <Key>F11:       string(0x1b)    string("[23~") \n \
        ~Shift  <Key>F12:       string(0x1b)    string("[24~") \n \
        Shift   <Key>F1:        string(0x1b)    string("[23~") \n \
        Shift   <Key>F2:        string(0x1b)    string("[24~") \n \
        Shift   <Key>F3:        string(0x1b)    string("[2p;            and give a decent vt220 emulation.

#
# Usage statement
Usage(){
        echo
        echo " Usage  : vmsterm -options"
        echo
        echo " Options: -80   for 80 column terminal"
        echo "          -132  for 132 column terminal"
        echo "          -bg colorname"
        echo "          -fg colorname"
        echo "          -fn fontname"
        echo "          -fb bold fontname"
        echo "          -host [crusher.saltmine.com] [earth] [192.168.7.7]"
        echo ""
        echo " Example: \"vmsterm -80 -fg white -bg black -fn 9x15 -fb 9x15b -host earth\""
        echo "          Starts a VMS session with an 80 column terminal"
        echo "          with a black background, white foreground, a normal"
        echo "          font of 9x15 and a bold font of 9x15b, and connects"
        echo "          to the node 'earth'"
        echo ""
        echo " Example: \"vmsterm -host earth\""
        echo "          Starts a VMS session with default terminal settings "
        echo ""
        echo " Example: \"vmsterm -help\""
        echo "          Displays vmsterm options "
        echo
        exit 1
}
 
# Default to a black foreground with a white background.
# Use the 9x15 and 9x15bold fonts. Connect to 192.168.3.3 by default.
#
FG=black
BG=white
HOST=192.168.3.3
FONT=9x15
BFONT=9x15bold
COLS=80
 
# Parse the command line arguments
#
while [ $# != 0 ];
do
        case $1 in
                -80)    COLS=80
                        FONT=spc12x24c
                        BFONT=spc12x24b
                        shift
                        ;;
                -132)   COLS=132
                        FONT=9x15
                        BFONT=9x15b
                        shift
                        ;;
                -fg)    shift
                        FG=$1
                        shift;;
                -bg)    shift
                        BG=$1
                        shift;;
                -fn)    shift
                        FONT=$1
                        shift;;
                -fb)    shift
                        BFONT=$1
                        shift;;
                -host)  shift
                        HOST=$1
                        shift;;
                -help)  Usage;;
                *)      Usage;;
        esac
done
 
xterm   -title "VMSTERM" -sb -sl 1000 -geo ${COLS}x24 -fg ${FG} -bg ${BG} \
        -cr blue -fn ${FONT} -fb ${BFONT} -xrm \
        'XTerm*VT100.translations: #override \n \
        ~Shift  <Key>F1:        string(0x1b)    string("OP") \n \
        ~Shift  <Key>F2:        string(0x1b)    string("OQ") \n \
        ~Shift  <Key>F3:        string(0x1b)    string("OR") \n \
        ~Shift  <Key>F4:        string(0x1b)    string("OS") \n \
        ~Shift  <Key>F5:        string("Break") \n \
        ~Shift  <Key>F6:        string(0x1b)    string("[17~") \n \
        ~Shift  <Key>F7:        string(0x1b)    string("[18~") \n \
        ~Shift  <Key>F8:        string(0x1b)    string("[19~") \n \
        ~Shift  <Key>F9:        string(0x1b)    string("[20~") \n \
        ~Shift  <Key>F10:       string(0x1b)    string("[21~") \n \
        ~Shift  <Key>F11:       string(0x1b)    string("[23~") \n \
        ~Shift  <Key>F12:       string(0x1b)    string("[24~") \n \
        Shift   <Key>F1:        string(0x1b)    string("[23~") \n \
        Shift   <Key>F2:        string(0x1b)    string("[24~") \n \
        Shift   <Key>F3:        string(0x1b)    string("[2p;            and give a decent vt220 emulation.

#
# Usage statement
Usage(){
        echo
        echo " Usage  : vmsterm -options"
        echo
        echo " Options: -80   for 80 column terminal"
        echo "          -132  for 132 column terminal"
        echo "          -bg colorname"
        echo "          -fg colorname"
        echo "          -fn fontname"
        echo "          -fb bold fontname"
        echo "          -host [crusher.saltmine.com] [earth] [192.168.7.7]"
        echo ""
        echo " Example: \"vmsterm -80 -fg white -bg black -fn 9x15 -fb 9x15b -host earth\""
        echo "          Starts a VMS session with an 80 column terminal"
        echo "          with a black background, white foreground, a normal"
        echo "          font of 9x15 and a bold font of 9x15b, and connects"
        echo "          to the node 'earth'"
        echo ""
        echo " Example: \"vmsterm -host earth\""
        echo "          Starts a VMS session with default terminal settings "
        echo ""
        echo " Example: \"vmsterm -help\""
        echo "          Displays vmsterm options "
        echo
        exit 1
}
 
# Default to a black foreground with a white background.
# Use the 9x15 and 9x15bold fonts. Connect to 192.168.3.3 by default.
#
FG=black
BG=white
HOST=192.168.3.3
FONT=9x15
BFONT=9x15bold
COLS=80
 
# Parse the command line arguments
#
while [ $# != 0 ];
do
        case $1 in
                -80)    COLS=80
                        FONT=spc12x24c
                        BFONT=spc12x24b
                        shift
                        ;;
                -132)   COLS=132
                        FONT=9x15
                        BFONT=9x15b
                        shift
                        ;;
                -fg)    shift
                        FG=$1
                        shift;;
                -bg)    shift
                        BG=$1
                        shift;;
                -fn)    shift
                        FONT=$1
                        shift;;
                -fb)    shift
                        BFONT=$1
                        shift;;
                -host)  shift
                        HOST=$1
                        shift;;
                -help)  Usage;;
                *)      Usage;;
        esac
done
 
xterm   -title "VMSTERM" -sb -sl 1000 -geo ${COLS}x24 -fg ${FG} -bg ${BG} \
        -cr blue -fn ${FONT} -fb ${BFONT} -xrm \
        'XTerm*VT100.translations: #override \n \
        ~Shift  <Key>F1:        string(0x1b)    string("OP") \n \
        ~Shift  <Key>F2:        string(0x1b)    string("OQ") \n \
        ~Shift  <Key>F3:        string(0x1b)    string("OR") \n \
        ~Shift  <Key>F4:        string(0x1b)    string("OS") \n \
        ~Shift  <Key>F5:        string("Break") \n \
        ~Shift  <Key>F6:        string(0x1b)    string("[17~") \n \
        ~Shift  <Key>F7:        string(0x1b)    string("[18~") \n \
        ~Shift  <Key>F8:        string(0x1b)    string("[19~") \n \
        ~Shift  <Key>F9:        string(0x1b)    string("[20~") \n \
        ~Shift  <Key>F10:       string(0x1b)    string("[21~") \n \
        ~Shift  <Key>F11:       string(0x1b)    string("[23~") \n \
        ~Shift  <Key>F12:       string(0x1b)    string("[24~") \n \
        Shift   <Key>F1:        string(0x1b)    string("[23~") \n \
        Shift   <Key>F2:        string(0x1b)    string("[24~") \n \
        Shift   <Key>F3:        string(0x1b)    string("[2p;            and give a decent vt220 emulation.

#
# Usage statement
Usage(){
        echo
        echo " Usage  : vmsterm -options"
        echo
        echo " Options: -80   for 80 column terminal"
        echo "          -132  for 132 column terminal"
        echo "          -bg colorname"
        echo "          -fg colorname"
        echo "          -fn fontname"
        echo "          -fb bold fontname"
        echo "          -host [crusher.saltmine.com] [earth] [192.168.7.7]"
        echo ""
        echo " Example: \"vmsterm -80 -fg white -bg black -fn 9x15 -fb 9x15b -host earth\""
        echo "          Starts a VMS session with an 80 column terminal"
        echo "          with a black background, white foreground, a normal"
        echo "          font of 9x15 and a bold font of 9x15b, and connects"
        echo "          to the node 'earth'"
        echo ""
        echo " Example: \"vmsterm -host earth\""
        echo "          Starts a VMS session with default terminal settings "
        echo ""
        echo " Example: \"vmsterm -help\""
        echo "          Displays vmsterm options "
        echo
        exit 1
}
 
# Default to a black foreground with a white background.
# Use the 9x15 and 9x15bold fonts. Connect to 192.168.3.3 by default.
#
FG=black
BG=white
HOST=192.168.3.3
FONT=9x15
BFONT=9x15bold
COLS=80
 
# Parse the command line arguments
#
while [ $# != 0 ];
do
        case $1 in
                -80)    COLS=80
                        FONT=spc12x24c
                        BFONT=spc12x24b
                        shift
                        ;;
                -132)   COLS=132
                        FONT=9x15
                        BFONT=9x15b
                        shift
                        ;;
                -fg)    shift
                        FG=$1
                        shift;;
                -bg)    shift
                        BG=$1
                        shift;;
                -fn)    shift
                        FONT=$1
                        shift;;
                -fb)    shift
                        BFONT=$1
                        shift;;
                -host)  shift
                        HOST=$1
                        shift;;
                -help)  Usage;;
                *)      Usage;;
        esac
done
 
xterm   -title "VMSTERM" -sb -sl 1000 -geo ${COLS}x24 -fg ${FG} -bg ${BG} \
        -cr blue -fn ${FONT} -fb ${BFONT} -xrm \
        'XTerm*VT100.translations: #override \n \
        ~Shift  <Key>F1:        string(0x1b)    string("OP") \n \
        ~Shift  <Key>F2:        string(0x1b)    string("OQ") \n \
        ~Shift  <Key>F3:        string(0x1b)    string("OR") \n \
        ~Shift  <Key>F4:        string(0x1b)    string("OS") \n \
        ~Shift  <Key>F5:        string("Break") \n \
        ~Shift  <Key>F6:        string(0x1b)    string("[17~") \n \
        ~Shift  <Key>F7:        string(0x1b)    string("[18~") \n \
        ~Shift  <Key>F8:        string(0x1b)    string("[19~") \n \
        ~Shift  <Key>F9:        string(0x1b)    string("[20~") \n \
        ~Shift  <Key>F10:       string(0x1b)    string("[21~") \n \
        ~Shift  <Key>F11:       string(0x1b)    string("[23~") \n \
        ~Shift  <Key>F12:       string(0x1b)    string("[24~") \n \
        Shift   <Key>F1:        string(0x1b)    string("[23~") \n \
        Shift   <Key>F2:        string(0x1b)    string("[24~") \n \
        Shift   <Key>F3:        string(0x1b)    string("[2p;            and give a decent vt220 emulation.

#
# Usage statement
Usage(){
        echo
        echo " Usage  : vmsterm -options"
        echo
        echo " Options: -80   for 80 column terminal"
        echo "          -132  for 132 column terminal"
        echo "          -bg colorname"
        echo "          -fg colorname"
        echo "          -fn fontname"
        echo "          -fb bold fontname"
        echo "          -host [crusher.saltmine.com] [earth] [192.168.7.7]"
        echo ""
        echo " Example: \"vmsterm -80 -fg white -bg black -fn 9x15 -fb 9x15b -host earth\""
        echo "          Starts a VMS session with an 80 column terminal"
        echo "          with a black background, white foreground, a normal"
        echo "          font of 9x15 and a bold font of 9x15b, and connects"
        echo "          to the node 'earth'"
        echo ""
        echo " Example: \"vmsterm -host earth\""
        echo "          Starts a VMS session with default terminal settings "
        echo ""
        echo " Example: \"vmsterm -help\""
        echo "          Displays vmsterm options "
        echo
        exit 1
}
 
# Default to a black foreground with a white background.
# Use the 9x15 and 9x15bold fonts. Connect to 192.168.3.3 by default.
#
FG=black
BG=white
HOST=192.168.3.3
FONT=9x15
BFONT=9x15bold
COLS=80
 
# Parse the command line arguments
#
while [ $# != 0 ];
do
        case $1 in
                -80)    COLS=80
                        FONT=spc12x24c
                        BFONT=spc12x24b
                        shift
                        ;;
                -132)   COLS=132
                        FONT=9x15
                        BFONT=9x15b
                        shift
                        ;;
                -fg)    shift
                        FG=$1
                        shift;;
                -bg)    shift
                        BG=$1
                        shift;;
                -fn)    shift
                        FONT=$1
                        shift;;
                -fb)    shift
                        BFONT=$1
                        shift;;
                -host)  shift
                        HOST=$1
                        shift;;
                -help)  Usage;;
                *)      Usage;;
        esac
done
 
xterm   -title "VMSTERM" -sb -sl 1000 -geo ${COLS}x24 -fg ${FG} -bg ${BG} \
        -cr blue -fn ${FONT} -fb ${BFONT} -xrm \
        'XTerm*VT100.translations: #override \n \
        ~Shift  <Key>F1:        string(0x1b)    string("OP") \n \
        ~Shift  <Key>F2:        string(0x1b)    string("OQ") \n \
        ~Shift  <Key>F3:        string(0x1b)    string("OR") \n \
        ~Shift  <Key>F4:        string(0x1b)    string("OS") \n \
        ~Shift  <Key>F5:        string("Break") \n \
        ~Shift  <Key>F6:        string(0x1b)    string("[17~") \n \
        ~Shift  <Key>F7:        string(0x1b)    string("[18~") \n \
        ~Shift  <Key>F8:        string(0x1b)    string("[19~") \n \
        ~Shift  <Key>F9:        string(0x1b)    string("[20~") \n \
        ~Shift  <Key>F10:       string(0x1b)    string("[21~") \n \
        ~Shift  <Key>F11:       string(0x1b)    string("[23~") \n \
        ~Shift  <Key>F12:       string(0x1b)    string("[24~") \n \
        Shift   <Key>F1:        string(0x1b)    string("[23~") \n \
        Shift   <Key>F2:        string(0x1b)    string("[24~") \n \
        Shift   <Key>F3:        string(0x1b)    string("[2p;            and give a decent vt220 emulation.

#
# Usage statement
Usage(){
        echo
        echo " Usage  : vmsterm -options"
        echo
        echo " Options: -80   for 80 column terminal"
        echo "          -132  for 132 column terminal"
        echo "          -bg colorname"
        echo "          -fg colorname"
        echo "          -fn fontname"
        echo "          -fb bold fontname"
        echo "          -host [crusher.saltmine.com] [earth] [192.168.7.7]"
        echo ""
        echo " Example: \"vmsterm -80 -fg white -bg black -fn 9x15 -fb 9x15b -host earth\""
        echo "          Starts a VMS session with an 80 column terminal"
        echo "          with a black background, white foreground, a normal"
        echo "          font of 9x15 and a bold font of 9x15b, and connects"
        echo "          to the node 'earth'"
        echo ""
        echo " Example: \"vmsterm -host earth\""
        echo "          Starts a VMS session with default terminal settings "
        echo ""
        echo " Example: \"vmsterm -help\""
        echo "          Displays vmsterm options "
        echo
        exit 1
}
 
# Default to a black foreground with a white background.
# Use the 9x15 and 9x15bold fonts. Connect to 192.168.3.3 by default.
#
FG=black
BG=white
HOST=192.168.3.3
FONT=9x15
BFONT=9x15bold
COLS=80
 
# Parse the command line arguments
#
while [ $# != 0 ];
do
        case $1 in
                -80)    COLS=80
                        FONT=spc12x24c
                        BFONT=spc12x24b
                        shift
                        ;;
                -132)   COLS=132
                        FONT=9x15
                        BFONT=9x15b
                        shift
                        ;;
                -fg)    shift
                        FG=$1
                        shift;;
                -bg)    shift
                        BG=$1
                        shift;;
                -fn)    shift
                        FONT=$1
                        shift;;
                -fb)    shift
                        BFONT=$1
                        shift;;
                -host)  shift
                        HOST=$1
                        shift;;
                -help)  Usage;;
                *)      Usage;;
        esac
done
 
xterm   -title "VMSTERM" -sb -sl 1000 -geo ${COLS}x24 -fg ${FG} -bg ${BG} \
        -cr blue -fn ${FONT} -fb ${BFONT} -xrm \
        'XTerm*VT100.translations: #override \n \
        ~Shift  <Key>F1:        string(0x1b)    string("OP") \n \
        ~Shift  <Key>F2:        string(0x1b)    string("OQ") \n \
        ~Shift  <Key>F3:        string(0x1b)    string("OR") \n \
        ~Shift  <Key>F4:        string(0x1b)    string("OS") \n \
        ~Shift  <Key>F5:        string("Break") \n \
        ~Shift  <Key>F6:        string(0x1b)    string("[17~") \n \
        ~Shift  <Key>F7:        string(0x1b)    string("[18~") \n \
        ~Shift  <Key>F8:        string(0x1b)    string("[19~") \n \
        ~Shift  <Key>F9:        string(0x1b)    string("[20~") \n \
        ~Shift  <Key>F10:       string(0x1b)    string("[21~") \n \
        ~Shift  <Key>F11:       string(0x1b)    string("[23~") \n \
        ~Shift  <Key>F12:       string(0x1b)    string("[24~") \n \
        Shift   <Key>F1:        string(0x1b)    string("[23~") \n \
        Shift   <Key>F2:        string(0x1b)    string("[24~") \n \
        Shift   <Key>F3:        string(0x1b)    string("[2p;            and give a decent vt220 emulation.

#
# Usage statement
Usage(){
        echo
        echo " Usage  : vmsterm -options"
        echo
        echo " Options: -80   for 80 column terminal"
        echo "          -132  for 132 column terminal"
        echo "          -bg colorname"
        echo "          -fg colorname"
        echo "          -fn fontname"
        echo "          -fb bold fontname"
        echo "          -host [crusher.saltmine.com] [earth] [192.168.7.7]"
        echo ""
        echo " Example: \"vmsterm -80 -fg white -bg black -fn 9x15 -fb 9x15b -host earth\""
        echo "          Starts a VMS session with an 80 column terminal"
        echo "          with a black background, white foreground, a normal"
        echo "          font of 9x15 and a bold font of 9x15b, and connects"
        echo "          to the node 'earth'"
        echo ""
        echo " Example: \"vmsterm -host earth\""
        echo "          Starts a VMS session with default terminal settings "
        echo ""
        echo " Example: \"vmsterm -help\""
        echo "          Displays vmsterm options "
        echo
        exit 1
}
 
# Default to a black foreground with a white background.
# Use the 9x15 and 9x15bold fonts. Connect to 192.168.3.3 by default.
#
FG=black
BG=white
HOST=192.168.3.3
FONT=9x15
BFONT=9x15bold
COLS=80
 
# Parse the command line arguments
#
while [ $# != 0 ];
do
        case $1 in
                -80)    COLS=80
                        FONT=spc12x24c
                        BFONT=spc12x24b
                        shift
                        ;;
                -132)   COLS=132
                        FONT=9x15
                        BFONT=9x15b
                        shift
                        ;;
                -fg)    shift
                        FG=$1
                        shift;;
                -bg)    shift
                        BG=$1
                        shift;;
                -fn)    shift
                        FONT=$1
                        shift;;
                -fb)    shift
                        BFONT=$1
                        shift;;
                -host)  shift
                        HOST=$1
                        shift;;
                -help)  Usage;;
                *)      Usage;;
        esac
done
 
xterm   -title "VMSTERM" -sb -sl 1000 -geo ${COLS}x24 -fg ${FG} -bg ${BG} \
        -cr blue -fn ${FONT} -fb ${BFONT} -xrm \
        'XTerm*VT100.translations: #override \n \
        ~Shift  <Key>F1:        string(0x1b)    string("OP") \n \
        ~Shift  <Key>F2:        string(0x1b)    string("OQ") \n \
        ~Shift  <Key>F3:        string(0x1b)    string("OR") \n \
        ~Shift  <Key>F4:        string(0x1b)    string("OS") \n \
        ~Shift  <Key>F5:        string("Break") \n \
        ~Shift  <Key>F6:        string(0x1b)    string("[17~") \n \
        ~Shift  <Key>F7:        string(0x1b)    string("[18~") \n \
        ~Shift  <Key>F8:        string(0x1b)    string("[19~") \n \
        ~Shift  <Key>F9:        string(0x1b)    string("[20~") \n \
        ~Shift  <Key>F10:       string(0x1b)    string("[21~") \n \
        ~Shift  <Key>F11:       string(0x1b)    string("[23~") \n \
        ~Shift  <Key>F12:       string(0x1b)    string("[24~") \n \
        Shift   <Key>F1:        string(0x1b)    string("[23~") \n \
        Shift   <Key>F2:        string(0x1b)    string("[24~") \n \
        Shift   <Key>F3:        string(0x1b)    string("[2p;            and give a decent vt220 emulation.

#
# Usage statement
Usage(){
        echo
        echo " Usage  : vmsterm -options"
        echo
        echo " Options: -80   for 80 column terminal"
        echo "          -132  for 132 column terminal"
        echo "          -bg colorname"
        echo "          -fg colorname"
        echo "          -fn fontname"
        echo "          -fb bold fontname"
        echo "          -host [crusher.saltmine.com] [earth] [192.168.7.7]"
        echo ""
        echo " Example: \"vmsterm -80 -fg white -bg black -fn 9x15 -fb 9x15b -host earth\""
        echo "          Starts a VMS session with an 80 column terminal"
        echo "          with a black background, white foreground, a normal"
        echo "          font of 9x15 and a bold font of 9x15b, and connects"
        echo "          to the node 'earth'"
        echo ""
        echo " Example: \"vmsterm -host earth\""
        echo "          Starts a VMS session with default terminal settings "
        echo ""
        echo " Example: \"vmsterm -help\""
        echo "          Displays vmsterm options "
        echo
        exit 1
}
 
# Default to a black foreground with a white background.
# Use the 9x15 and 9x15bold fonts. Connect to 192.168.3.3 by default.
#
FG=black
BG=white
HOST=192.168.3.3
FONT=9x15
BFONT=9x15bold
COLS=80
 
# Parse the command line arguments
#
while [ $# != 0 ];
do
        case $1 in
                -80)    COLS=80
                        FONT=spc12x24c
                        BFONT=spc12x24b
                        shift
                        ;;
                -132)   COLS=132
                        FONT=9x15
                        BFONT=9x15b
                        shift
                        ;;
                -fg)    shift
                        FG=$1
                        shift;;
                -bg)    shift
                        BG=$1
                        shift;;
                -fn)    shift
                        FONT=$1
                        shift;;
                -fb)    shift
                        BFONT=$1
                        shift;;
                -host)  shift
                        HOST=$1
                        shift;;
                -help)  Usage;;
                *)      Usage;;
        esac
done
 
xterm   -title "VMSTERM" -sb -sl 1000 -geo ${COLS}x24 -fg ${FG} -bg ${BG} \
        -cr blue -fn ${FONT} -fb ${BFONT} -xrm \
        'XTerm*VT100.translations: #override \n \
        ~Shift  <Key>F1:        string(0x1b)    string("OP") \n \
        ~Shift  <Key>F2:        string(0x1b)    string("OQ") \n \
        ~Shift  <Key>F3:        string(0x1b)    string("OR") \n \
        ~Shift  <Key>F4:        string(0x1b)    string("OS") \n \
        ~Shift  <Key>F5:        string("Break") \n \
        ~Shift  <Key>F6:        string(0x1b)    string("[17~") \n \
        ~Shift  <Key>F7:        string(0x1b)    string("[18~") \n \
        ~Shift  <Key>F8:        string(0x1b)    string("[19~") \n \
        ~Shift  <Key>F9:        string(0x1b)    string("[20~") \n \
        ~Shift  <Key>F10:       string(0x1b)    string("[21~") \n \
        ~Shift  <Key>F11:       string(0x1b)    string("[23~") \n \
        ~Shift  <Key>F12:       string(0x1b)    string("[24~") \n \
        Shift   <Key>F1:        string(0x1b)    string("[23~") \n \
        Shift   <Key>F2:        string(0x1b)    string("[24~") \n \
        Shift   <Key>F3:        string(0x1b)    string("[2p;            and give a decent vt220 emulation.

#
# Usage statement
Usage(){
        echo
        echo " Usage  : vmsterm -options"
        echo
        echo " Options: -80   for 80 column terminal"
        echo "          -132  for 132 column terminal"
        echo "          -bg colorname"
        echo "          -fg colorname"
        echo "          -fn fontname"
        echo "          -fb bold fontname"
        echo "          -host [crusher.saltmine.com] [earth] [192.168.7.7]"
        echo ""
        echo " Example: \"vmsterm -80 -fg white -bg black -fn 9x15 -fb 9x15b -host earth\""
        echo "          Starts a VMS session with an 80 column terminal"
        echo "          with a black background, white foreground, a normal"
        echo "          font of 9x15 and a bold font of 9x15b, and connects"
        echo "          to the node 'earth'"
        echo ""
        echo " Example: \"vmsterm -host earth\""
        echo "          Starts a VMS session with default terminal settings "
        echo ""
        echo " Example: \"vmsterm -help\""
        echo "          Displays vmsterm options "
        echo
        exit 1
}
 
# Default to a black foreground with a white background.
# Use the 9x15 and 9x15bold fonts. Connect to 192.168.3.3 by default.
#
FG=black
BG=white
HOST=192.168.3.3
FONT=9x15
BFONT=9x15bold
COLS=80
 
# Parse the command line arguments
#
while [ $# != 0 ];
do
        case $1 in
                -80)    COLS=80
                        FONT=spc12x24c
                        BFONT=spc12x24b
                        shift
                        ;;
                -132)   COLS=132
                        FONT=9x15
                        BFONT=9x15b
                        shift
                        ;;
                -fg)    shift
                        FG=$1
                        shift;;
                -bg)    shift
                        BG=$1
                        shift;;
                -fn)    shift
                        FONT=$1
                        shift;;
                -fb)    shift
                        BFONT=$1
                        shift;;
                -host)  shift
                        HOST=$1
                        shift;;
                -help)  Usage;;
                *)      Usage;;
        esac
done
 
xterm   -title "VMSTERM" -sb -sl 1000 -geo ${COLS}x24 -fg ${FG} -bg ${BG} \
        -cr blue -fn ${FONT} -fb ${BFONT} -xrm \
        'XTerm*VT100.translations: #override \n \
        ~Shift  <Key>F1:        string(0x1b)    string("OP") \n \
        ~Shift  <Key>F2:        string(0x1b)    string("OQ") \n \
        ~Shift  <Key>F3:        string(0x1b)    string("OR") \n \
        ~Shift  <Key>F4:        string(0x1b)    string("OS") \n \
        ~Shift  <Key>F5:        string("Break") \n \
        ~Shift  <Key>F6:        string(0x1b)    string("[17~") \n \
        ~Shift  <Key>F7:        string(0x1b)    string("[18~") \n \
        ~Shift  <Key>F8:        string(0x1b)    string("[19~") \n \
        ~Shift  <Key>F9:        string(0x1b)    string("[20~") \n \
        ~Shift  <Key>F10:       string(0x1b)    string("[21~") \n \
        ~Shift  <Key>F11:       string(0x1b)    string("[23~") \n \
        ~Shift  <Key>F12:       string(0x1b)    string("[24~") \n \
        Shift   <Key>F1:        string(0x1b)    string("[23~") \n \
        Shift   <Key>F2:        string(0x1b)    string("[24~") \n \
        Shift   <Key>F3:        string(0x1b)    string("[2p;            and give a decent vt220 emulation.

#
# Usage statement
Usage(){
        echo
        echo " Usage  : vmsterm -options"
        echo
        echo " Options: -80   for 80 column terminal"
        echo "          -132  for 132 column terminal"
        echo "          -bg colorname"
        echo "          -fg colorname"
        echo "          -fn fontname"
        echo "          -fb bold fontname"
        echo "          -host [crusher.saltmine.com] [earth] [192.168.7.7]"
        echo ""
        echo " Example: \"vmsterm -80 -fg white -bg black -fn 9x15 -fb 9x15b -host earth\""
        echo "          Starts a VMS session with an 80 column terminal"
        echo "          with a black background, white foreground, a normal"
        echo "          font of 9x15 and a bold font of 9x15b, and connects"
        echo "          to the node 'earth'"
        echo ""
        echo " Example: \"vmsterm -host earth\""
        echo "          Starts a VMS session with default terminal settings "
        echo ""
        echo " Example: \"vmsterm -help\""
        echo "          Displays vmsterm options "
        echo
        exit 1
}
 
# Default to a black foreground with a white background.
# Use the 9x15 and 9x15bold fonts. Connect to 192.168.3.3 by default.
#
FG=black
BG=white
HOST=192.168.3.3
FONT=9x15
BFONT=9x15bold
COLS=80
 
# Parse the command line arguments
#
while [ $# != 0 ];
do
        case $1 in
                -80)    COLS=80
                        FONT=spc12x24c
                        BFONT=spc12x24b
                        shift
                        ;;
                -132)   COLS=132
                        FONT=9x15
                        BFONT=9x15b
                        shift
                        ;;
                -fg)    shift
                        FG=$1
                        shift;;
                -bg)    shift
                        BG=$1
                        shift;;
                -fn)    shift
                        FONT=$1
                        shift;;
                -fb)    shift
                        BFONT=$1
                        shift;;
                -host)  shift
                        HOST=$1
                        shift;;
                -help)  Usage;;
                *)      Usage;;
        esac
done
 
xterm   -title "VMSTERM" -sb -sl 1000 -geo ${COLS}x24 -fg ${FG} -bg ${BG} \
        -cr blue -fn ${FONT} -fb ${BFONT} -xrm \
        'XTerm*VT100.translations: #override \n \
        ~Shift  <Key>F1:        string(0x1b)    string("OP") \n \
        ~Shift  <Key>F2:        string(0x1b)    string("OQ") \n \
        ~Shift  <Key>F3:        string(0x1b)    string("OR") \n \
        ~Shift  <Key>F4:        string(0x1b)    string("OS") \n \
        ~Shift  <Key>F5:        string("Break") \n \
        ~Shift  <Key>F6:        string(0x1b)    string("[17~") \n \
        ~Shift  <Key>F7:        string(0x1b)    string("[18~") \n \
        ~Shift  <Key>F8:        string(0x1b)    string("[19~") \n \
        ~Shift  <Key>F9:        string(0x1b)    string("[20~") \n \
        ~Shift  <Key>F10:       string(0x1b)    string("[21~") \n \
        ~Shift  <Key>F11:       string(0x1b)    string("[23~") \n \
        ~Shift  <Key>F12:       string(0x1b)    string("[24~") \n \
        Shift   <Key>F1:        string(0x1b)    string("[23~") \n \
        Shift   <Key>F2:        string(0x1b)    string("[24~") \n \
        Shift   <Key>F3:        string(0x1b)    string("[2p;            and give a decent vt220 emulation.

#
# Usage statement
Usage(){
        echo
        echo " Usage  : vmsterm -options"
        echo
        echo " Options: -80   for 80 column terminal"
        echo "          -132  for 132 column terminal"
        echo "          -bg colorname"
        echo "          -fg colorname"
        echo "          -fn fontname"
        echo "          -fb bold fontname"
        echo "          -host [crusher.saltmine.com] [earth] [192.168.7.7]"
        echo ""
        echo " Example: \"vmsterm -80 -fg white -bg black -fn 9x15 -fb 9x15b -host earth\""
        echo "          Starts a VMS session with an 80 column terminal"
        echo "          with a black background, white foreground, a normal"
        echo "          font of 9x15 and a bold font of 9x15b, and connects"
        echo "          to the node 'earth'"
        echo ""
        echo " Example: \"vmsterm -host earth\""
        echo "          Starts a VMS session with default terminal settings "
        echo ""
        echo " Example: \"vmsterm -help\""
        echo "          Displays vmsterm options "
        echo
        exit 1
}
 
# Default to a black foreground with a white background.
# Use the 9x15 and 9x15bold fonts. Connect to 192.168.3.3 by default.
#
FG=black
BG=white
HOST=192.168.3.3
FONT=9x15
BFONT=9x15bold
COLS=80
 
# Parse the command line arguments
#
while [ $# != 0 ];
do
        case $1 in
                -80)    COLS=80
                        FONT=spc12x24c
                        BFONT=spc12x24b
                        shift
                        ;;
                -132)   COLS=132
                        FONT=9x15
                        BFONT=9x15b
                        shift
                        ;;
                -fg)    shift
                        FG=$1
                        shift;;
                -bg)    shift
                        BG=$1
                        shift;;
                -fn)    shift
                        FONT=$1
                        shift;;
                -fb)    shift
                        BFONT=$1
                        shift;;
                -host)  shift
                        HOST=$1
                        shift;;
                -help)  Usage;;
                *)      Usage;;
        esac
done
 
xterm   -title "VMSTERM" -sb -sl 1000 -geo ${COLS}x24 -fg ${FG} -bg ${BG} \
        -cr blue -fn ${FONT} -fb ${BFONT} -xrm \
        'XTerm*VT100.translations: #override \n \
        ~Shift  <Key>F1:        string(0x1b)    string("OP") \n \
        ~Shift  <Key>F2:        string(0x1b)    string("OQ") \n \
        ~Shift  <Key>F3:        string(0x1b)    string("OR") \n \
        ~Shift  <Key>F4:        string(0x1b)    string("OS") \n \
        ~Shift  <Key>F5:        string("Break") \n \
        ~Shift  <Key>F6:        string(0x1b)    string("[17~") \n \
        ~Shift  <Key>F7:        string(0x1b)    string("[18~") \n \
        ~Shift  <Key>F8:        string(0x1b)    string("[19~") \n \
        ~Shift  <Key>F9:        string(0x1b)    string("[20~") \n \
        ~Shift  <Key>F10:       string(0x1b)    string("[21~") \n \
        ~Shift  <Key>F11:       string(0x1b)    string("[23~") \n \
        ~Shift  <Key>F12:       string(0x1b)    string("[24~") \n \
        Shift   <Key>F1:        string(0x1b)    string("[23~") \n \