Copyright 1997-2003,2004 by Thomas E. Dickey

Contents


What is XTERM?

From the manual page:
The xterm program is a terminal emulator for the X Window System. It provides DEC VT102 and Tektronix 4014 compatible terminals for programs that can't 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.

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 distributed with XFree86, which is based on the X11R6.3 xterm, with the addition of ANSI color and VT220 controls.

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:

Most of these 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.

What is the latest version?

The most recent (and well supported) version of xterm is the XFree86 version. I have a copy at

Ftp: ftp://invisible-island.net/xterm/xterm.tar.gz

What versions are available?

There are several other versions of xterm, as well as similar programs. These include (I am aware of a few others, such as xcterm, but have not seen a working version of these).

There were for some time two versions of XFree86 xterm. Starting with my patch 88, there were the stable (beta) and unstable (alpha) versions, which currently are XFree86 3.3.6 and XFree86 4.x, respectively. I made only critical changes to the stable version since patch 88; ongoing development (including all non-critical fixes) was focused on the "unstable".

XFree86 4.0 should have incorporated my patch 131, but it was overlooked at the last moment (though it was listed in the ChangeLog, the patch itself was not applied). Unfortunately, the patch 130 version which was released renders colors incorrectly on most platforms, in particular FreeBSD. Ironically, the change in patch 129 which introduced this bug was designed to work around a bug which I have seen only running with FreeBSD. To compound the irony, there was some resistance at the time (2000/4/5) by that organization to incorporating the fix because it might be confused with the 4.0 release version.

How do I ...

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

How do I change the font size?

This is in the manpage, in MENUS.

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.

XFree86 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.

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 XFree86 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, XFree86 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 XFree86 xterm, this is relatively simple. So I'll answer that first.

With X Consortium xterm, you have 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).

XFree86 xterm changes 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 XFree86 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). XFree86 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 "          -13tudent 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 distributed with XFree86, which is based on the X11R6.3 xterm, with the addition of ANSI color and VT220 controls.

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:

Most of these 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.

What is the latest version?

The most recent (and well supported) version of xterm is the XFree86 version. I have a copy at

Ftp: ftp://invisible-island.net/xterm/xterm.tar.gz

What versions are available?

There are several other versions of xterm, as well as similar programs. These include (I am aware of a few others, such as xcterm, but have not seen a working version of these).

There were for some time two versions of XFree86 xterm. Starting with my patch 88, there were the stable (beta) and unstable (alpha) versions, which currently are XFree86 3.3.6 and XFree86 4.x, respectively. I made only critical changes to the stable version since patch 88; ongoing development (including all non-critical fixes) was focused on the "unstable".

XFree86 4.0 should have incorporated my patch 131, but it was overlooked at the last moment (though it was listed in the ChangeLog, the patch itself was not applied). Unfortunately, the patch 130 version which was released renders colors incorrectly on most platforms, in particular FreeBSD. Ironically, the change in patch 129 which introduced this bug was designed to work around a bug which I have seen only running with FreeBSD. To compound the irony, there was some resistance at the time (2000/4/5) by that organization to incorporating the fix because it might be confused with the 4.0 release version.

How do I ...

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

How do I change the font size?

This is in the manpage, in MENUS.

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.

XFree86 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.

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 XFree86 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, XFree86 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 XFree86 xterm, this is relatively simple. So I'll answer that first.

With X Consortium xterm, you have 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).

XFree86 xterm changes 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 XFree86 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). XFree86 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 "          -13tudent 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 distributed with XFree86, which is based on the X11R6.3 xterm, with the addition of ANSI color and VT220 controls.

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:
  • AIX 3.2.5 (cc)
  • Digital Unix 3.2, 4.0 (cc)
  • FreeBSD 2.2.6 to 5.1 (gcc 2.8)
  • HP-UX 9.05 (gcc 2.7.2)
  • IRIX 5.2, 6.2 (cc, gcc 2.7.2, gcc 2.8)
  • Linux 2.0.0 to 2.4.22 (gcc 2.7.2 to 3.3)
  • SCO OpenServer 5 (cc, gcc).
  • Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8 (cc, gcc 2.7.2)
  • SunOS 4.1.1, 4.1.3 (gcc 2.7.2)

Most of these 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.

What is the latest version?

The most recent (and well supported) version of xterm is the XFree86 version. I have a copy at

Ftp: ftp://invisible-island.net/xterm/xterm.tar.gz

What versions are available?

There are several other versions of xterm, as well as similar programs. These include (I am aware of a few others, such as xcterm, but have not seen a working version of these).

There were for some time two versions of XFree86 xterm. Starting with my patch 88, there were the stable (beta) and unstable (alpha) versions, which currently are XFree86 3.3.6 and XFree86 4.x, respectively. I made only critical changes to the stable version since patch 88; ongoing development (including all non-critical fixes) was focused on the "unstable".

XFree86 4.0 should have incorporated my patch 131, but it was overlooked at the last moment (though it was listed in the ChangeLog, the patch itself was not applied). Unfortunately, the patch 130 version which was released renders colors incorrectly on most platforms, in particular FreeBSD. Ironically, the change in patch 129 which introduced this bug was designed to work around a bug which I have seen only running with FreeBSD. To compound the irony, there was some resistance at the time (2000/4/5) by that organization to incorporating the fix because it might be confused with the 4.0 release version.

How do I ...

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

How do I change the font size?

This is in the manpage, in MENUS.

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.

XFree86 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.

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:

  • Every character is recorded. Even cursor movement, if you run an editor.
  • You must start a new shell to capture the typescript file.
Well, what about logging? Some versions of xterm support logging to a file. In fact XFree86 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
  • Every character is recorded. Even cursor movement, if you run an editor.
  • Line drawing characters are translated to control characters, i.e., codes 0-31 (this may be fixed sometime, it is a problem inherited from X Consortium xterm).
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, XFree86 xterm implements, as part of the VT100 emulation, an "attached" printer.

  • The printer is really a pipe command, to which xterm writes.
  • You can print the current line, page, or continuously with the corresponding control sequences. That takes an application program which knows how to print the screen.
  • If you do not have an application, xterm has a popup menu entry to print the window.
There are limitations and tradeoffs using the "attached" printer, because it is an emulation:
  • The emulation is based on detailed documentation for a VT320. This states that control sequences are sent in each line to reset bold, underlining and other printable attributes, and to set them as needed. Your printer probably does not understand this sort of input. Use the xterm resource printAttributes to get more easily printed output.
  • The printer may hang. Not really, but it seems that way. If you use the "attached" printer from an application designed for the VT100 terminal, it is written with the assumption that the printer is a dedicated piece of hardware, printing onto a continuous form. Use the printerAutoClose resource to change xterm's behavior to close the printer pipe whenever the terminal is told to switch the printer offline.
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 XFree86 xterm, this is relatively simple. So I'll answer that first.

With X Consortium xterm, you have 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).

XFree86 xterm changes 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 XFree86 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). XFree86 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 "          -13tudent 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 distributed with XFree86, which is based on the X11R6.3 xterm, with the addition of ANSI color and VT220 controls.

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:
  • AIX 3.2.5 (cc)
  • Digital Unix 3.2, 4.0 (cc)
  • FreeBSD 2.2.6 to 5.1 (gcc 2.8)
  • HP-UX 9.05 (gcc 2.7.2)
  • IRIX 5.2, 6.2 (cc, gcc 2.7.2, gcc 2.8)
  • Linux 2.0.0 to 2.4.22 (gcc 2.7.2 to 3.3)
  • SCO OpenServer 5 (cc, gcc).
  • Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8 (cc, gcc 2.7.2)
  • SunOS 4.1.1, 4.1.3 (gcc 2.7.2)

Most of these 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.

What is the latest version?

The most recent (and well supported) version of xterm is the XFree86 version. I have a copy at

Ftp: ftp://invisible-island.net/xterm/xterm.tar.gz

What versions are available?

There are several other versions of xterm, as well as similar programs. These include (I am aware of a few others, such as xcterm, but have not seen a working version of these).

There were for some time two versions of XFree86 xterm. Starting with my patch 88, there were the stable (beta) and unstable (alpha) versions, which currently are XFree86 3.3.6 and XFree86 4.x, respectively. I made only critical changes to the stable version since patch 88; ongoing development (including all non-critical fixes) was focused on the "unstable".

XFree86 4.0 should have incorporated my patch 131, but it was overlooked at the last moment (though it was listed in the ChangeLog, the patch itself was not applied). Unfortunately, the patch 130 version which was released renders colors incorrectly on most platforms, in particular FreeBSD. Ironically, the change in patch 129 which introduced this bug was designed to work around a bug which I have seen only running with FreeBSD. To compound the irony, there was some resistance at the time (2000/4/5) by that organization to incorporating the fix because it might be confused with the 4.0 release version.

How do I ...

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

How do I change the font size?

This is in the manpage, in MENUS.

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.

XFree86 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.

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:

  • Every character is recorded. Even cursor movement, if you run an editor.
  • You must start a new shell to capture the typescript file.
Well, what about logging? Some versions of xterm support logging to a file. In fact XFree86 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
  • Every character is recorded. Even cursor movement, if you run an editor.
  • Line drawing characters are translated to control characters, i.e., codes 0-31 (this may be fixed sometime, it is a problem inherited from X Consortium xterm).
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, XFree86 xterm implements, as part of the VT100 emulation, an "attached" printer.

  • The printer is really a pipe command, to which xterm writes.
  • You can print the current line, page, or continuously with the corresponding control sequences. That takes an application program which knows how to print the screen.
  • If you do not have an application, xterm has a popup menu entry to print the window.
There are limitations and tradeoffs using the "attached" printer, because it is an emulation:
  • The emulation is based on detailed documentation for a VT320. This states that control sequences are sent in each line to reset bold, underlining and other printable attributes, and to set them as needed. Your printer probably does not understand this sort of input. Use the xterm resource printAttributes to get more easily printed output.
  • The printer may hang. Not really, but it seems that way. If you use the "attached" printer from an application designed for the VT100 terminal, it is written with the assumption that the printer is a dedicated piece of hardware, printing onto a continuous form. Use the printerAutoClose resource to change xterm's behavior to close the printer pipe whenever the terminal is told to switch the printer offline.
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 XFree86 xterm, this is relatively simple. So I'll answer that first.

With X Consortium xterm, you have 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).

XFree86 xterm changes 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 XFree86 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). XFree86 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 "          -13tudent 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 distributed with XFree86, which is based on the X11R6.3 xterm, with the addition of ANSI color and VT220 controls.

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:
  • AIX 3.2.5 (cc)
  • Digital Unix 3.2, 4.0 (cc)
  • FreeBSD 2.2.6 to 5.1 (gcc 2.8)
  • HP-UX 9.05 (gcc 2.7.2)
  • IRIX 5.2, 6.2 (cc, gcc 2.7.2, gcc 2.8)
  • Linux 2.0.0 to 2.4.22 (gcc 2.7.2 to 3.3)
  • SCO OpenServer 5 (cc, gcc).
  • Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8 (cc, gcc 2.7.2)
  • SunOS 4.1.1, 4.1.3 (gcc 2.7.2)

Most of these 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.

What is the latest version?

The most recent (and well supported) version of xterm is the XFree86 version. I have a copy at

Ftp: ftp://invisible-island.net/xterm/xterm.tar.gz

What versions are available?

There are several other versions of xterm, as well as similar programs. These include (I am aware of a few others, such as xcterm, but have not seen a working version of these).

There were for some time two versions of XFree86 xterm. Starting with my patch 88, there were the stable (beta) and unstable (alpha) versions, which currently are XFree86 3.3.6 and XFree86 4.x, respectively. I made only critical changes to the stable version since patch 88; ongoing development (including all non-critical fixes) was focused on the "unstable".

XFree86 4.0 should have incorporated my patch 131, but it was overlooked at the last moment (though it was listed in the ChangeLog, the patch itself was not applied). Unfortunately, the patch 130 version which was released renders colors incorrectly on most platforms, in particular FreeBSD. Ironically, the change in patch 129 which introduced this bug was designed to work around a bug which I have seen only running with FreeBSD. To compound the irony, there was some resistance at the time (2000/4/5) by that organization to incorporating the fix because it might be confused with the 4.0 release version.

How do I ...

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

How do I change the font size?

This is in the manpage, in MENUS.

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.

XFree86 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.

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:

  • Every character is recorded. Even cursor movement, if you run an editor.
  • You must start a new shell to capture the typescript file.
Well, what about logging? Some versions of xterm support logging to a file. In fact XFree86 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
  • Every character is recorded. Even cursor movement, if you run an editor.
  • Line drawing characters are translated to control characters, i.e., codes 0-31 (this may be fixed sometime, it is a problem inherited from X Consortium xterm).
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, XFree86 xterm implements, as part of the VT100 emulation, an "attached" printer.

  • The printer is really a pipe command, to which xterm writes.
  • You can print the current line, page, or continuously with the corresponding control sequences. That takes an application program which knows how to print the screen.
  • If you do not have an application, xterm has a popup menu entry to print the window.
There are limitations and tradeoffs using the "attached" printer, because it is an emulation:
  • The emulation is based on detailed documentation for a VT320. This states that control sequences are sent in each line to reset bold, underlining and other printable attributes, and to set them as needed. Your printer probably does not understand this sort of input. Use the xterm resource printAttributes to get more easily printed output.
  • The printer may hang. Not really, but it seems that way. If you use the "attached" printer from an application designed for the VT100 terminal, it is written with the assumption that the printer is a dedicated piece of hardware, printing onto a continuous form. Use the printerAutoClose resource to change xterm's behavior to close the printer pipe whenever the terminal is told to switch the printer offline.
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 XFree86 xterm, this is relatively simple. So I'll answer that first.

With X Consortium xterm, you have 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).

XFree86 xterm changes 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 XFree86 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). XFree86 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 "          -13tudent 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 distributed with XFree86, which is based on the X11R6.3 xterm, with the addition of ANSI color and VT220 controls.

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:
  • AIX 3.2.5 (cc)
  • Digital Unix 3.2, 4.0 (cc)
  • FreeBSD 2.2.6 to 5.1 (gcc 2.8)
  • HP-UX 9.05 (gcc 2.7.2)
  • IRIX 5.2, 6.2 (cc, gcc 2.7.2, gcc 2.8)
  • Linux 2.0.0 to 2.4.22 (gcc 2.7.2 to 3.3)
  • SCO OpenServer 5 (cc, gcc).
  • Solaris 2.4, 2.5, 2.5.1, 2.6, 7, 8 (cc, gcc 2.7.2)
  • SunOS 4.1.1, 4.1.3 (gcc 2.7.2)

Most of these 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.

What is the latest version?

The most recent (and well supported) version of xterm is the XFree86 version. I have a copy at

Ftp: ftp://invisible-island.net/xterm/xterm.tar.gz

What versions are available?

There are several other versions of xterm, as well as similar programs. These include (I am aware of a few others, such as xcterm, but have not seen a working version of these).

There were for some time two versions of XFree86 xterm. Starting with my patch 88, there were the stable (beta) and unstable (alpha) versions, which currently are XFree86 3.3.6 and XFree86 4.x, respectively. I made only critical changes to the stable version since patch 88; ongoing development (including all non-critical fixes) was focused on the "unstable".

XFree86 4.0 should have incorporated my patch 131, but it was overlooked at the last moment (though it was listed in the ChangeLog, the patch itself was not applied). Unfortunately, the patch 130 version which was released renders colors incorrectly on most platforms, in particular FreeBSD. Ironically, the change in patch 129 which introduced this bug was designed to work around a bug which I have seen only running with FreeBSD. To compound the irony, there was some resistance at the time (2000/4/5) by that organization to incorporating the fix because it might be confused with the 4.0 release version.

How do I ...

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

How do I change the font size?

This is in the manpage, in MENUS.

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.

XFree86 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.

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:

  • Every character is recorded. Even cursor movement, if you run an editor.
  • You must start a new shell to capture the typescript file.
Well, what about logging? Some versions of xterm support logging to a file. In fact XFree86 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
  • Every character is recorded. Even cursor movement, if you run an editor.
  • Line drawing characters are translated to control characters, i.e., codes 0-31 (this may be fixed sometime, it is a problem inherited from X Consortium xterm).
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, XFree86 xterm implements, as part of the VT100 emulation, an "attached" printer.

  • The printer is really a pipe command, to which xterm writes.
  • You can print the current line, page, or continuously with the corresponding control sequences. That takes an application program which knows how to print the screen.
  • If you do not have an application, xterm has a popup menu entry to print the window.
There are limitations and tradeoffs using the "attached" printer, because it is an emulation:
  • The emulation is based on detailed documentation for a VT320. This states that control sequences are sent in each line to reset bold, underlining and other printable attributes, and to set them as needed. Your printer probably does not understand this sort of input. Use the xterm resource printAttributes to get more easily printed output.
  • The printer may hang. Not really, but it seems that way. If you use the "attached" printer from an application designed for the VT100 terminal, it is written with the assumption that the printer is a dedicated piece of hardware, printing onto a continuous form. Use the printerAutoClose resource to change xterm's behavior to close the printer pipe whenever the terminal is told to switch the printer offline.
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 XFree86 xterm, this is relatively simple. So I'll answer that first.

With X Consortium xterm, you have 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).

XFree86 xterm changes 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 XFree86 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). XFree86 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 "          -13tudent 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