[comp.sources.x] v09i043: colxterm -- Color xterm, Part13/14

tomw@orac.esd.sgi.com (Tom Weinstein) (09/14/90)

Submitted-by: Tom Weinstein <tomw@orac.esd.sgi.com>
Posting-number: Volume 9, Issue 43
Archive-name: colxterm/part13

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then feed it
# into a shell via "sh file" or similar.  To overwrite existing files,
# type "sh file -c".
# The tool that generated this appeared in the comp.sources.unix newsgroup;
# send mail to comp-sources-unix@uunet.uu.net if you want that tool.
# If this archive is complete, you will see the following message at the end:
#		"End of archive 13 (of 14)."
# Contents:  xterm/Imakefile xterm/README.new xterm/VTparse.h
#   xterm/charproc.c.ad xterm/cursor.c xterm/data.c xterm/error.h
#   xterm/input.c xterm/tabs.c xterm/x10ctlseq.ms
# Wrapped by argv@turnpike on Thu Sep 13 20:42:35 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'xterm/Imakefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xterm/Imakefile'\"
else
echo shar: Extracting \"'xterm/Imakefile'\" \(3115 characters\)
sed "s/^X//" >'xterm/Imakefile' <<'END_OF_FILE'
X/**/###########################################################################
X/**/#                                                                         #
X/**/#                         Attention xterm porters                         #
X/**/#                                                                         #
X/**/#                                                                         #
X/**/# Xterm assumes that bcopy can handle overlapping arguments.  If your     #
X/**/# bcopy (or memcpy) can't, write a routine called bcopy and link it in    #
X/**/# or add -Dbcopy=mybcopy to the DEFINES list below.                       #
X/**/#                                                                         #
X/**/###########################################################################
X
X#ifdef BandAidCompiler
X#include BandAidCompiler
X#endif
X
X/*
X * add -DWTMP and -DLASTLOG if you want them; make sure that bcopy can
X * handle overlapping copies before using it.
X */
X#ifdef SetTtyGroup			/* turn on in config/machine.cf */
X   TTYGROUPDEF = -DUSE_TTY_GROUP
X#endif
X/*
X *	[PUCC = Purdue University Computer Center]
X *	If you use PUCC's ptyd, add "-DPUCC_PTYD" to the DEFINES
X *	and dink the -DUTMP (also don't define WTMP or LASTLOG - since
X *	ptyd does all that logging for you)  You will need to add
X *	the right library load line (we use -lpucc) to the 
X *	ComplexProgramTarget (right next to -ltermcap)
X */
X#ifdef UsePUCCPtyd			/* turn on in config/site.def */
X    PUCCPTYDDEF = -DPUCC_PTYD		/* does not need to be setuid */
X         PTYLIB = -lpucc
X#endif
X
X   MAIN_DEFINES = -DUTMP $(TTYGROUPDEF) $(PUCCPTYDDEF) -DWTMP -DLASTLOG
X   MISC_DEFINES = /* -DALLOWLOGFILEEXEC */
X
X          SRCS1 = button.c charproc.c cursor.c data.c input.c \
X		  main.c menu.c misc.c screen.c scrollbar.c tabs.c \
X		  TekPrsTbl.c Tekproc.c util.c VTPrsTbl.c
X          OBJS1 = main.o input.o charproc.o cursor.o util.o tabs.o \
X		  screen.o scrollbar.o button.o Tekproc.o misc.o \
X		  VTPrsTbl.o TekPrsTbl.o data.o menu.o
X          SRCS2 = resize.c
X          OBJS2 = resize.o
X           SRCS = $(SRCS1) $(SRCS2)
X           OBJS = $(OBJS1) $(OBJS2)
X       PROGRAMS = resize xterm
X       DEPLIBS1 = XawClientDepLibs
X       DEPLIBS2 = 
X       PROGRAMS = xterm resize
X
X#ifndef TermcapLibrary
X#if SystemV && !defined(MacIIArchitecture)
X#ifdef CrayArchitecture
X#define TermcapLibrary -lcurses		/* special case of system v */
X#else
X#define TermcapLibrary -ltermlib	/* usually in here */
X#endif
X#else
X#define TermcapLibrary -ltermcap	/* bsd puts it here */
X#endif
X#endif
X
X     TERMCAPLIB = TermcapLibrary
X
XAllTarget($(PROGRAMS))
X
XSpecialObjectRule(main.o, ,$(MAIN_DEFINES))
XSpecialObjectRule(misc.o, ,$(MISC_DEFINES))
XSpecialObjectRule(charproc.o, ,$(MISC_DEFINES))
X
XNormalProgramTarget(xterm,$(OBJS1),$(DEPLIBS1),XawClientLibs,$(TERMCAPLIB) $(PTYLIB))
XInstallProgramWithFlags(xterm, $(BINDIR), $(INSTUIDFLAGS))
X
XNormalProgramTarget(resize,$(OBJS2),$(DEPLIBS2), ,$(TERMCAPLIB))
XInstallProgramWithFlags(resize, $(BINDIR), )
X
XInstallAppDefaults(XTerm)
XInstallManPage(xterm,$(MANDIR))
XInstallManPage(resize,$(MANDIR))
XDependTarget()
END_OF_FILE
if test 3115 -ne `wc -c <'xterm/Imakefile'`; then
    echo shar: \"'xterm/Imakefile'\" unpacked with wrong size!
fi
# end of 'xterm/Imakefile'
fi
if test -f 'xterm/README.new' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xterm/README.new'\"
else
echo shar: Extracting \"'xterm/README.new'\" \(3357 characters\)
sed "s/^X//" >'xterm/README.new' <<'END_OF_FILE'
XWell, here it is, finally.  This is basically an R4 xterm with lots of
Xchanges.  The major changes are listed below.  I should emphasize that
Xno differences from the raw R4 xterm are in any way official MIT stuff.
X
XA lot of this was done in our spare time, and Silicon Graphics takes
Xabsolutely no responsibility for any of this.  The authors of the
Xmajor pieces of code are listed purely to give credit where credit
Xis due.  Please don't bother anyone but me about this, as Erik and Paul
Xare both extremely busy guys.
X
XIt is conceivable that I will continue to work on the color stuff now
Xthat I'm going to be back at school, so if anyone wants to fix
Xsomething, or enhance something I'll be happy to take your patches.
X
XHere are the major changes we've made:
X
X1) Rearranged and rewrote most of main.c
X
X     Paul Shupak (shupak@esd.sgi.com) did most of this.
X
X2) Added ISO 6429 support for color text.  You can set the foreground
X   and background color for text using SGR.  For example, to make the
X   foreground red, you do:  "^[[31m".  The values from 30 to 37 set
X   foreground, those from 40 to 47 set background.  The default colors
X   are:
X	0) black   1) red   2) green  3) yellow  4) blue  5) magenta
X	6) cyan    7) white
X
X   These are settable with the resources "color0" to "color1".
X
X3) Added a resource, menu option, and command line flag for selecting
X   between scrolling by bliting the window, and scrolling by redrawing
X   the whole window.  On some servers (most notably SGI's ;-) redrawing
X   is faster than bliting.  The command line flags are -blt/+blt, and
X   the resource is "bltScroll".
X
X     Both 2) and 3) are the fault of me, Tom Weinstein.
X				(tomw@esd.sgi.com, tom@bears.ucsb.edu)
X
X		NOTE:  I'll be back at ucsb after Sept 19th, and my sgi
X		       address will no longer be valid.
X
X4) Added escape sequences to set the primary rendition text foreground
X   color, background color, text cursor color,  mouse foreground and
X   background colors and the Tektronix mode Foreground and Background
X   colors.  These are done with a 'Set Text Parameters' control sequence
X   (^[]Ps^G) where Ps is 10-16 followed by a list of color names.  For
X   more details, see the cltseqs document.  This feature can be enabled
X   with the dynamicColor resource.  One useful trick you can do with
X   this feature is to have different color backgrounds depending on what
X   machine you are logged onto.  A simple escape sequence in your prompt
X   string ensures that the color is right, even when you rlogin to
X   another machine.
X
X    This was designed and implemented by Erik Fortune (erik@esd.sgi.com).
X
X
XOne thing to note is that the ANSI color, and the dynamic color features
Xare totally orthogonal and use completely different color
Xrepresentations.  The ANSI color uses eight predefined colors, and the
Xdynamic color uses color names, include #NNN specifications.
X
XTom Weinstein
XSilicon Graphics, Inc., Entry Systems Division, Window Systems
Xtomw@orac.esd.sgi.com
XAny opinions expressed above are mine, not sgi's.
X
X****************************************************************
X*                                                              *
X* NOTE: After Sept 19th, my address will be tom@bears.ucsb.edu *
X*                                                              *
X****************************************************************
END_OF_FILE
if test 3357 -ne `wc -c <'xterm/README.new'`; then
    echo shar: \"'xterm/README.new'\" unpacked with wrong size!
fi
# end of 'xterm/README.new'
fi
if test -f 'xterm/VTparse.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xterm/VTparse.h'\"
else
echo shar: Extracting \"'xterm/VTparse.h'\" \(3170 characters\)
sed "s/^X//" >'xterm/VTparse.h' <<'END_OF_FILE'
X/*
X *	$XConsortium: VTparse.h,v 1.4 89/01/04 13:37:49 jim Exp $
X */
X
X
X#include <X11/copyright.h>
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.
X *
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X
X/* @(#)VTparse.h	X10/6.6	11/6/86 */
X
X/*
X * The following list of definitions is generated from VTparse.def using the
X * following command line:
X *
X *     egrep -v '^CASE_' VTparse.def | \
X *     awk 'BEGIN {n = 0;} {printf "#define %s %d\n", $1, n; n++}'
X *
X * You you need to change something, change VTparse.def and regenerate the
X * definitions.  This would have been automatic, but since this doesn't change
X * very often, it isn't worth the makefile hassle.
X */
X
X#define CASE_GROUND_STATE 0
X#define CASE_IGNORE_STATE 1
X#define CASE_IGNORE_ESC 2
X#define CASE_IGNORE 3
X#define CASE_BELL 4
X#define CASE_BS 5
X#define CASE_CR 6
X#define CASE_ESC 7
X#define CASE_VMOT 8
X#define CASE_TAB 9
X#define CASE_SI 10
X#define CASE_SO 11
X#define CASE_SCR_STATE 12
X#define CASE_SCS0_STATE 13
X#define CASE_SCS1_STATE 14
X#define CASE_SCS2_STATE 15
X#define CASE_SCS3_STATE 16
X#define CASE_ESC_IGNORE 17
X#define CASE_ESC_DIGIT 18
X#define CASE_ESC_SEMI 19
X#define CASE_DEC_STATE 20
X#define CASE_ICH 21
X#define CASE_CUU 22
X#define CASE_CUD 23
X#define CASE_CUF 24
X#define CASE_CUB 25
X#define CASE_CUP 26
X#define CASE_ED 27
X#define CASE_EL 28
X#define CASE_IL 29
X#define CASE_DL 30
X#define CASE_DCH 31
X#define CASE_DA1 32
X#define CASE_TRACK_MOUSE 33
X#define CASE_TBC 34
X#define CASE_SET 35
X#define CASE_RST 36
X#define CASE_SGR 37
X#define CASE_CPR 38
X#define CASE_DECSTBM 39
X#define CASE_DECREQTPARM 40
X#define CASE_DECSET 41
X#define CASE_DECRST 42
X#define CASE_DECALN 43
X#define CASE_GSETS 44
X#define CASE_DECSC 45
X#define CASE_DECRC 46
X#define CASE_DECKPAM 47
X#define CASE_DECKPNM 48
X#define CASE_IND 49
X#define CASE_NEL 50
X#define CASE_HTS 51
X#define CASE_RI 52
X#define CASE_SS2 53
X#define CASE_SS3 54
X#define CASE_CSI_STATE 55
X#define CASE_OSC 56
X#define CASE_RIS 57
X#define CASE_LS2 58
X#define CASE_LS3 59
X#define CASE_LS3R 60
X#define CASE_LS2R 61
X#define CASE_LS1R 62
X#define CASE_PRINT 63
X#define CASE_XTERM_SAVE 64
X#define CASE_XTERM_RESTORE 65
X#define CASE_XTERM_TITLE 66
X#define CASE_DECID 67
END_OF_FILE
if test 3170 -ne `wc -c <'xterm/VTparse.h'`; then
    echo shar: \"'xterm/VTparse.h'\" unpacked with wrong size!
fi
# end of 'xterm/VTparse.h'
fi
if test -f 'xterm/charproc.c.ad' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xterm/charproc.c.ad'\"
else
echo shar: Extracting \"'xterm/charproc.c.ad'\" \(2536 characters\)
sed "s/^X//" >'xterm/charproc.c.ad' <<'END_OF_FILE'
X
Xset_vt_box (screen)
X	TScreen *screen;
X{
X	XPoint	*vp;
X
X	vp = &VTbox[1];
X	(vp++)->x = FontWidth(screen) - 1;
X	(vp++)->y = FontHeight(screen) - 1;
X	(vp++)->x = -(FontWidth(screen) - 1);
X	vp->y = -(FontHeight(screen) - 1);
X	screen->box = VTbox;
X}
X
X
Xset_cursor_gcs (screen)
X    TScreen *screen;
X{
X    XGCValues xgcv;
X    unsigned long mask;
X    unsigned long cc = screen->cursorcolor;
X    unsigned long fg = screen->foreground;
X    unsigned long bg = term->core.background_pixel;
X    GC new_cursorGC = NULL, new_reversecursorGC = NULL;
X    GC new_cursoroutlineGC = NULL;
X
X    /*
X     * Let's see, there are three things that have "color":
X     *
X     *     background
X     *     text
X     *     cursorblock
X     *
X     * And, there are four situation when drawing a cursor, if we decide
X     * that we like have a solid block of cursor color with the letter
X     * that it is highlighting shown in the background color to make it
X     * stand out:
X     *
X     *     selected window, normal video - background on cursor
X     *     selected window, reverse video - foreground on cursor
X     *     unselected window, normal video - foreground on background
X     *     unselected window, reverse video - background on foreground
X     *
X     * Since the last two are really just normalGC and reverseGC, we only
X     * need two new GC's.  Under monochrome, we get the same effect as
X     * above by setting cursor color to foreground.
X     */
X
X    xgcv.font = screen->fnt_norm->fid;
X    mask = (GCForeground | GCBackground | GCFont);
X    if (cc != fg && cc != bg) {
X	/* we have a colored cursor */
X	xgcv.foreground = fg;
X	xgcv.background = cc;
X	new_cursorGC = XtGetGC ((Widget) term, mask, &xgcv);
X
X	if (screen->always_highlight) {
X	    new_reversecursorGC = (GC) 0;
X	    new_cursoroutlineGC = (GC) 0;
X	} else {
X	    xgcv.foreground = bg;
X	    xgcv.background = cc;
X	    new_reversecursorGC = XtGetGC ((Widget) term, mask, &xgcv);
X	    xgcv.foreground = cc;
X	    xgcv.background = bg;
X	    new_cursoroutlineGC = XtGetGC ((Widget) term, mask, &xgcv);
X		}
X    } else {
X	new_cursorGC = (GC) 0;
X	new_reversecursorGC = (GC) 0;
X	new_cursoroutlineGC = (GC) 0;
X    }
X    if (screen->cursorGC) XtReleaseGC ((Widget)term, screen->cursorGC);
X    if (screen->reversecursorGC)
X	XtReleaseGC ((Widget)term, screen->reversecursorGC);
X    if (screen->cursoroutlineGC)
X	XtReleaseGC ((Widget)term, screen->cursoroutlineGC);
X    screen->cursorGC = new_cursorGC;
X    screen->reversecursorGC = new_reversecursorGC;
X    screen->cursoroutlineGC = new_cursoroutlineGC;
X}
END_OF_FILE
if test 2536 -ne `wc -c <'xterm/charproc.c.ad'`; then
    echo shar: \"'xterm/charproc.c.ad'\" unpacked with wrong size!
fi
# end of 'xterm/charproc.c.ad'
fi
if test -f 'xterm/cursor.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xterm/cursor.c'\"
else
echo shar: Extracting \"'xterm/cursor.c'\" \(6374 characters\)
sed "s/^X//" >'xterm/cursor.c' <<'END_OF_FILE'
X/*
X *	$XConsortium: cursor.c,v 1.8 90/06/06 09:18:31 jim Exp $
X */
X
X#ifndef lint
Xstatic char *rcsid_cursor_c = "$XConsortium: cursor.c,v 1.8 90/06/06 09:18:31 jim Exp $";
X#endif	/* lint */
X
X#include <X11/copyright.h>
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.
X *
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X
X/* cursor.c */
X
X
X#ifndef lint
Xstatic char rcs_id[] = "$XConsortium: cursor.c,v 1.8 90/06/06 09:18:31 jim Exp $";
X#endif	/* lint */
X
X#include <X11/Xlib.h>
X#include <stdio.h>
X#include <sys/ioctl.h>
X#include "ptyx.h"
X
Xextern void bcopy();
X
Xstatic void _CheckSelection(screen)
Xregister TScreen *screen;
X{
X    extern XtermWidget term;	/* %%% gross */
X
X    if (screen->cur_row > screen->endHRow ||
X	(screen->cur_row == screen->endHRow &&
X	 screen->cur_col >= screen->endHCol)) {}
X    else
X	DisownSelection(term);
X}
X
X
X
X/*
X * Moves the cursor to the specified position, checking for bounds.
X * (this includes scrolling regions)
X * The origin is considered to be 0, 0 for this procedure.
X */
XCursorSet(screen, row, col, flags)
Xregister TScreen	*screen;
Xregister int	row, col;
Xunsigned	flags;
X{
X	register int maxr;
X
X	col = (col < 0 ? 0 : col);
X	screen->cur_col = (col <= screen->max_col ? col : screen->max_col);
X	maxr = screen->max_row;
X	if (flags & ORIGIN) {
X		row += screen->top_marg;
X		maxr = screen->bot_marg;
X	}
X	row = (row < 0 ? 0 : row);
X	screen->cur_row = (row <= maxr ? row : maxr);
X	screen->do_wrap = 0;
X	_CheckSelection(screen);
X}
X
X/*
X * moves the cursor left n, no wrap around
X */
XCursorBack(screen, n)
Xregister TScreen	*screen;
Xint		n;
X{
X	register int i, j, k, rev;
X	extern XtermWidget term;
X
X	if((rev = (term->flags & (REVERSEWRAP | WRAPAROUND)) ==
X	 (REVERSEWRAP | WRAPAROUND)) && screen->do_wrap)
X		n--;
X	if ((screen->cur_col -= n) < 0) {
X		if(rev) {
X			if((i = (j = screen->max_col + 1) * screen->cur_row +
X			 screen->cur_col) < 0) {
X				k = j * (screen->max_row + 1);
X				i += ((-i) / k + 1) * k;
X			}
X			screen->cur_row = i / j;
X			screen->cur_col = i % j;
X		} else
X			screen->cur_col = 0;
X	}
X	screen->do_wrap = 0;
X	_CheckSelection(screen);
X}
X
X/*
X * moves the cursor forward n, no wraparound
X */
XCursorForward(screen, n)
Xregister TScreen	*screen;
Xint		n;
X{
X	screen->cur_col += n;
X	if (screen->cur_col > screen->max_col)
X		screen->cur_col = screen->max_col;
X	screen->do_wrap = 0;
X	_CheckSelection(screen);
X}
X
X/* 
X * moves the cursor down n, no scrolling.
X * Won't pass bottom margin or bottom of screen.
X */
XCursorDown(screen, n)
Xregister TScreen	*screen;
Xint		n;
X{
X	register int max;
X
X	max = (screen->cur_row > screen->bot_marg ?
X		screen->max_row : screen->bot_marg);
X
X	screen->cur_row += n;
X	if (screen->cur_row > max)
X		screen->cur_row = max;
X	screen->do_wrap = 0;
X	_CheckSelection(screen);
X}
X
X/* 
X * moves the cursor up n, no linestarving.
X * Won't pass top margin or top of screen.
X */
XCursorUp(screen, n)
Xregister TScreen	*screen;
Xint		n;
X{
X	register int min;
X
X	min = (screen->cur_row < screen->top_marg ?
X		0 : screen->top_marg);
X
X	screen->cur_row -= n;
X	if (screen->cur_row < min)
X		screen->cur_row = min;
X	screen->do_wrap = 0;
X	_CheckSelection(screen);
X}
X
X/* 
X * Moves cursor down amount lines, scrolls if necessary.
X * Won't leave scrolling region. No carriage return.
X */
XIndex(screen, amount)
Xregister TScreen	*screen;
Xregister int	amount;
X{
X	register int j;
X
X	/* 
X	 * indexing when below scrolling region is cursor down.
X	 * if cursor high enough, no scrolling necessary.
X	 */
X	if (screen->cur_row > screen->bot_marg
X	 || screen->cur_row + amount <= screen->bot_marg) {
X		CursorDown(screen, amount);
X		return;
X	}
X
X	CursorDown(screen, j = screen->bot_marg - screen->cur_row);
X	Scroll(screen, amount - j);
X}
X
X/*
X * Moves cursor up amount lines, reverse scrolls if necessary.
X * Won't leave scrolling region. No carriage return.
X */
XRevIndex(screen, amount)
Xregister TScreen	*screen;
Xregister int	amount;
X{
X	/*
X	 * reverse indexing when above scrolling region is cursor up.
X	 * if cursor low enough, no reverse indexing needed
X	 */
X	if (screen->cur_row < screen->top_marg
X	 || screen->cur_row-amount >= screen->top_marg) {
X		CursorUp(screen, amount);
X		return;
X	}
X
X	RevScroll(screen, amount - (screen->cur_row - screen->top_marg));
X	CursorUp(screen, screen->cur_row - screen->top_marg);
X}
X
X/*
X * Moves Cursor To First Column In Line
X */
XCarriageReturn(screen)
Xregister TScreen *screen;
X{
X	extern void ScrnSetAttributes();
X	
X	ScrnSetAttributes(screen, screen->cur_row, screen->cur_col,
X			  ENDLINE, ENDLINE, 1);
X	screen->cur_col = 0;
X	screen->do_wrap = 0;
X	_CheckSelection(screen);
X}
X
X/*
X * Save Cursor and Attributes
X */
XCursorSave(term, sc)
Xregister XtermWidget term;
Xregister SavedCursor *sc;
X{
X	register TScreen *screen = &term->screen;
X
X	sc->row = screen->cur_row;
X	sc->col = screen->cur_col;
X	sc->flags = term->flags;
X	sc->curgl = screen->curgl;
X	sc->curgr = screen->curgr;
X	bcopy(screen->gsets, sc->gsets, sizeof(screen->gsets));
X}
X
X/*
X * Restore Cursor and Attributes
X */
XCursorRestore(term, sc)
Xregister XtermWidget term;
Xregister SavedCursor *sc;
X{
X	register TScreen *screen = &term->screen;
X
X	bcopy(sc->gsets, screen->gsets, sizeof(screen->gsets));
X	screen->curgl = sc->curgl;
X	screen->curgr = sc->curgr;
X	term->flags &= ~(BOLD|INVERSE|UNDERLINE|ORIGIN);
X	term->flags |= sc->flags & (BOLD|INVERSE|UNDERLINE|ORIGIN);
X	CursorSet (screen, (term->flags & ORIGIN) ? sc->row - screen->top_marg
X			   : sc->row, sc->col, term->flags);
X}
END_OF_FILE
if test 6374 -ne `wc -c <'xterm/cursor.c'`; then
    echo shar: \"'xterm/cursor.c'\" unpacked with wrong size!
fi
# end of 'xterm/cursor.c'
fi
if test -f 'xterm/data.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xterm/data.c'\"
else
echo shar: Extracting \"'xterm/data.c'\" \(2560 characters\)
sed "s/^X//" >'xterm/data.c' <<'END_OF_FILE'
X/*
X *	$XConsortium: data.c,v 1.8 89/05/26 18:10:43 jim Exp $
X */
X
X#include <X11/copyright.h>
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.
X *
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X
X#include <setjmp.h>
X#include <X11/Xlib.h>
X#include <X11/Intrinsic.h>
X#include "ptyx.h"
X#include "data.h"
X
X#ifndef lint
Xstatic char rcs_id[] = "$XConsortium: data.c,v 1.8 89/05/26 18:10:43 jim Exp $";
X#endif	/* lint */
X
XXPoint T_boxlarge[NBOX] = {
X	{0, 0},
X	{8, 0},
X	{0, 14},
X	{-8, 0},
X	{0, -14},
X};
XXPoint T_box2[NBOX] = {
X	{0, 0},
X	{7, 0},
X	{0, 12},
X	{-7, 0},
X	{0, -12},
X};
XXPoint T_box3[NBOX] = {
X	{0, 0},
X	{5, 0},
X	{0, 12},
X	{-5, 0},
X	{0, -12},
X};
XXPoint T_boxsmall[NBOX] = {
X	{0, 0},
X	{5, 0},
X	{0, 9},
X	{-5, 0},
X	{0, -9},
X};
Xjmp_buf Tekend;
Xint Tbcnt = 0;
XChar *Tbuffer;
XChar *Tbptr;
XTekLink *TekRefresh;
XChar *Tpushb;
XChar *Tpushback;
Xint Ttoggled = 0;
Xint bcnt = 0;
XChar buffer[BUF_SIZE];
XChar *bptr = buffer;
Xjmp_buf VTend;
XXPoint VTbox[NBOX] = {
X	{0, 0},
X	{0, 0},
X	{0, 0},
X	{0, 0},
X	{0, 0},
X};
X
X#ifdef DEBUG
Xint debug = 0; 		/* true causes error messages to be displayed */
X#endif	/* DEBUG */
XXtermWidget term;		/* master data structure for client */
Xchar *xterm_name;	/* argv[0] */
Xint am_slave = 0;	/* set to 1 if running as a slave process */
Xint max_plus1;
Xint pty_mask;
Xint Select_mask;
Xint X_mask;
Xchar *ptydev;
Xchar *ttydev;
Xchar log_def_name[] = "XtermLog.XXXXX";
Xint T_lastx = -1;
Xint T_lasty = -1;
X
Xint waitingForTrackInfo = 0;
XEventMode eventMode = NORMAL;
X
XGC visualBellGC;
X
Xint VTgcFontMask = GCFont;
Xint TEKgcFontMask = GCFont;
X
XTekWidget tekWidget;
END_OF_FILE
if test 2560 -ne `wc -c <'xterm/data.c'`; then
    echo shar: \"'xterm/data.c'\" unpacked with wrong size!
fi
# end of 'xterm/data.c'
fi
if test -f 'xterm/error.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xterm/error.h'\"
else
echo shar: Extracting \"'xterm/error.h'\" \(4916 characters\)
sed "s/^X//" >'xterm/error.h' <<'END_OF_FILE'
X/*
X *	$XConsortium: error.h,v 1.6 89/05/26 13:34:16 jim Exp $
X */
X
X
X#include <X11/copyright.h>
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.
X *
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X
X/* @(#)error.h	X10/6.6	11/6/86 */
X/* main.c */
X#define	ERROR_KMALLOC	10	/* main: malloc() failed for keyboardtype */
X#define	ERROR_FIONBIO	11	/* main: ioctl() failed on FIONBIO */
X
X
X#define	ERROR_OPDEVTTY	14	/* spawn: open() failed on /dev/tty */
X#define	ERROR_TIOCGETP	15	/* spawn: ioctl() failed on TIOCGETP */
X#define	ERROR_TIOCGETC	16	/* spawn: ioctl() failed on TIOCGETC */
X#define	ERROR_TIOCGETD	17	/* spawn: ioctl() failed on TIOCGETD */
X#define	ERROR_TIOCGLTC	18	/* spawn: ioctl() failed on TIOCGLTC */
X#define	ERROR_TIOCLGET	19	/* spawn: ioctl() failed on TIOCLGET */
X#define	ERROR_TIOCCONS	20	/* spawn: ioctl() failed on TIOCCONS */
X#define	ERROR_OPDEVTTY2	21	/* spawn: second open() failed on /dev/tty */
X#define	ERROR_NOTTY	22	/* spawn: ioctl() failed on TIOCNOTTY */
X#define	ERROR_TIOCSETP	23	/* spawn: ioctl() failed on TIOCSETP */
X#define	ERROR_TIOCSETC	24	/* spawn: ioctl() failed on TIOCSETC */
X#define	ERROR_TIOCSETD	25	/* spawn: ioctl() failed on TIOCSETD */
X#define	ERROR_TIOCSLTC	26	/* spawn: ioctl() failed on TIOCSLTC */
X#define	ERROR_TIOCLSET	27	/* spawn: ioctl() failed on TIOCLSET */
X
X#define	ERROR_FORK	29	/* spawn: fork() failed */
X#define	ERROR_EXEC	30	/* spawn: exec() failed */
X#define	ERROR_OPDEVTTY3	31	/* spawn: third open() failed on /dev/tty */
X#define	ERROR_PTYS	32	/* get_pty: not enough ptys */
X#define	ERROR_NOX	33	/* get_terminal: can't connect to server */
X#define ERROR_PTY_EXEC	34	/* waiting for initial map */
X
X#define	ERROR_INIT	36	/* spawn: can't initialize window */
X#define	ERROR_NOCO	37	/* resize: no `co' in termcap */
X#define	ERROR_NOLI	38	/* resize: no `li' in termcap */
X#define	ERROR_BORDER	39	/* get_terminal: can't make border tile */
X#define	ERROR_BACK	40	/* get_terminal: can't make background tile */
X#define ERROR_NOX3      43      /* get_terminal: bad pty from display server */
X/* charproc.c */
X#define	ERROR_SELECT	50	/* in_put: select() failed */
X#define	ERROR_VINIT	54	/* VTInit: can't initialize window */
X#define	ERROR_CNMALLOC1	55	/* Changename: malloc failed */
X#define	ERROR_CNMALLOC2	56	/* Changename: malloc failed */
X/* Tekproc.c */
X#define	ERROR_TSELECT	60	/* Tinput: select() failed */
X#define	ERROR_TINIT	64	/* TekInit: can't initialize window */
X#define	ERROR_TBACK	65	/* TekBackground: can't make background */
X/* button.c */
X#define	ERROR_BMALLOC2	71	/* SaltTextAway: malloc() failed */
X
X/* misc.c */
X#define	ERROR_LOGEXEC	80	/* StartLog: exec() failed */
X#define	ERROR_XERROR	83	/* xerror: XError event */
X#define	ERROR_XIOERROR	84	/* xioerror: X I/O error */
X#define ERROR_WINNAME   85      /* get_terminal: malloc failed */
X/* screen.c */
X#define	ERROR_SCALLOC	90	/* Alloc: calloc() failed on base */
X#define	ERROR_SCALLOC2	91	/* Alloc: calloc() failed on rows */
X#define	ERROR_SREALLOC	92	/* ScreenResize: realloc() failed on alt base */
X#define	ERROR_SREALLOC2	93	/* ScreenResize: realloc() failed on alt rows */
X#define	ERROR_SREALLOC3	94	/* ScreenResize: realloc() failed on rows */
X#define	ERROR_SREALLOC4	95	/* ScreenResize: realloc() failed on rows */
X#define	ERROR_RESIZE	96	/* ScreenResize: malloc() or realloc() failed */
X#define	ERROR_RESIZE2	97	/* ScreenResize: malloc() or realloc() failed */
X#define	ERROR_RESIZROW	98	/* ScreenResize: realloc() failed on alt char */
X#define	ERROR_RESIZROW2	99	/* ScreenResize: realloc() failed on alt attr */
X#define	ERROR_RESIZROW3	100	/* ScreenResize: realloc() failed on attr */
X#define	ERROR_RESIZROW4	101	/* ScreenResize: realloc() failed on attr */
X/* scrollbar.c */
X#define	ERROR_SBRALLOC	110	/* ScrollBarOn: realloc() failed on base */
X#define	ERROR_SBRALLOC2	111	/* ScrollBarOn: realloc() failed on rows */
X/* util.c */
X#define	ERROR_UBACK	120	/* ReverseVideo: can't make background */
END_OF_FILE
if test 4916 -ne `wc -c <'xterm/error.h'`; then
    echo shar: \"'xterm/error.h'\" unpacked with wrong size!
fi
# end of 'xterm/error.h'
fi
if test -f 'xterm/input.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xterm/input.c'\"
else
echo shar: Extracting \"'xterm/input.c'\" \(7268 characters\)
sed "s/^X//" >'xterm/input.c' <<'END_OF_FILE'
X/*
X *	$XConsortium: input.c,v 1.10 90/06/07 15:49:57 jim Exp $
X */
X
X#ifndef lint
Xstatic char *rcsid_input_c = "$XConsortium: input.c,v 1.10 90/06/07 15:49:57 jim Exp $";
X#endif	/* lint */
X
X#include <X11/copyright.h>
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.
X *
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X
X/* input.c */
X
X#ifndef lint
Xstatic char rcs_id[] = "$XConsortium: input.c,v 1.10 90/06/07 15:49:57 jim Exp $";
X#endif	/* lint */
X
X#include <X11/Xlib.h>
X#include <X11/keysym.h>
X#include <X11/DECkeysym.h>
X#include <X11/Intrinsic.h>
X#include <X11/Xutil.h>
X#include <stdio.h>
X#include "ptyx.h"
X
Xstatic XComposeStatus compose_status = {NULL, 0};
Xstatic char *kypd_num = " XXXXXXXX\tXXX\rXXXxxxxXXXXXXXXXXXXXXXXXXXXX*+,-./0123456789XXX=";
Xstatic char *kypd_apl = " ABCDEFGHIJKLMNOPQRSTUVWXYZ??????abcdefghijklmnopqrstuvwxyzXXX";
Xstatic char *cur = "DACB";
X
Xstatic int funcvalue(), sunfuncvalue();
Xextern Boolean sunFunctionKeys;
X
Xvoid
XAdjustAfterInput (screen)
Xregister TScreen *screen;
X{
X	if(screen->scrollkey && screen->topline != 0)
X		WindowScroll(screen, 0);
X	if(screen->marginbell) {
X		int col = screen->max_col - screen->nmarginbell;
X		if(screen->bellarmed >= 0) {
X			if(screen->bellarmed == screen->cur_row) {
X				if(screen->cur_col >= col) {
X					if(screen->cur_col == col)
X						Bell();
X					screen->bellarmed = -1;
X				}
X			} else
X				screen->bellarmed = screen->cur_col <
X				 col ? screen->cur_row : -1;
X		} else if(screen->cur_col < col)
X			screen->bellarmed = screen->cur_row;
X	}
X}
X
XInput (keyboard, screen, event, eightbit)
Xregister TKeyboard	*keyboard;
Xregister TScreen		*screen;
Xregister XKeyPressedEvent *event;
XBool eightbit;
X{
X
X#define STRBUFSIZE 100
X
X	 char strbuf[STRBUFSIZE];
X	register char *string;
X	register int key = FALSE;
X	int	pty	= screen->respond;
X	int	nbytes;
X	KeySym  keysym;
X	ANSI	reply;
X
X	nbytes = XLookupString ((XKeyEvent *)event, strbuf, STRBUFSIZE, 
X		&keysym, &compose_status);
X
X	string = &strbuf[0];
X	reply.a_pintro = 0;
X	reply.a_final = 0;
X	reply.a_nparam = 0;
X	reply.a_inters = 0;
X
X	if (IsPFKey(keysym)) {
X		reply.a_type = SS3;
X		unparseseq(&reply, pty);
X		unparseputc((char)(keysym-XK_KP_F1+'P'), pty);
X		key = TRUE;
X	} else if (IsKeypadKey(keysym)) {
X	  	if (keyboard->flags & KYPD_APL)	{
X			reply.a_type   = SS3;
X			unparseseq(&reply, pty);
X			unparseputc(kypd_apl[keysym-XK_KP_Space], pty);
X		} else
X			unparseputc(kypd_num[keysym-XK_KP_Space], pty);
X		key = TRUE;
X        } else if (IsCursorKey(keysym) &&
X        	keysym != XK_Prior && keysym != XK_Next) {
X       		if (keyboard->flags & CURSOR_APL) {
X			reply.a_type = SS3;
X			unparseseq(&reply, pty);
X			unparseputc(cur[keysym-XK_Left], pty);
X		} else {
X			reply.a_type = CSI;
X			reply.a_final = cur[keysym-XK_Left];
X			unparseseq(&reply, pty);
X		}
X		key = TRUE;
X	 } else if (IsFunctionKey(keysym) || IsMiscFunctionKey(keysym) ||
X	 	keysym == XK_Prior || keysym == XK_Next ||
X	 	keysym == DXK_Remove) {
X		reply.a_type = CSI;
X		reply.a_nparam = 1;
X		if (sunFunctionKeys) {
X		    reply.a_param[0] = sunfuncvalue (keysym);
X		    reply.a_final = 'z';
X		} else {
X		    reply.a_param[0] = funcvalue (keysym);
X		    reply.a_final = '~';
X		}
X		if (reply.a_param[0] > 0)
X			unparseseq(&reply, pty);
X		key = TRUE;
X	} else if (nbytes > 0) {
X		if(screen->TekGIN) {
X			TekEnqMouse(*string++);
X			TekGINoff();
X			nbytes--;
X		}
X		if ((nbytes == 1) && eightbit) {
X		    if (screen->input_eight_bits)
X		      *string |= 0x80;	/* turn on eighth bit */
X		    else
X		      unparseputc (033, pty);  /* escape */
X		}
X		while (nbytes-- > 0)
X			unparseputc(*string++, pty);
X		key = TRUE;
X	}
X	if(key && !screen->TekEmu)
X	        AdjustAfterInput(screen);
X#ifdef ENABLE_PRINT
X	if (keysym == XK_F2) TekPrint();
X#endif
X	return;
X}
X
XStringInput (screen, string)
Xregister TScreen	*screen;
Xregister char *string;
X{
X	int	pty	= screen->respond;
X	int	nbytes;
X
X	nbytes = strlen(string);
X	if(nbytes && screen->TekGIN) {
X		TekEnqMouse(*string++);
X		TekGINoff();
X		nbytes--;
X	}
X	while (nbytes-- > 0)
X		unparseputc(*string++, pty);
X	if(!screen->TekEmu)
X	        AdjustAfterInput(screen);
X}
X
Xstatic int funcvalue (keycode)
X	int keycode;
X{
X	switch (keycode) {
X		case XK_F1:	return(11);
X		case XK_F2:	return(12);
X		case XK_F3:	return(13);
X		case XK_F4:	return(14);
X		case XK_F5:	return(15);
X		case XK_F6:	return(17);
X		case XK_F7:	return(18);
X		case XK_F8:	return(19);
X		case XK_F9:	return(20);
X		case XK_F10:	return(21);
X		case XK_F11:	return(23);
X		case XK_F12:	return(24);
X		case XK_F13:	return(25);
X		case XK_F14:	return(26);
X		case XK_F15:	return(28);
X		case XK_Help:	return(28);
X		case XK_F16:	return(29);
X		case XK_Menu:	return(29);
X		case XK_F17:	return(31);
X		case XK_F18:	return(32);
X		case XK_F19:	return(33);
X		case XK_F20:	return(34);
X
X		case XK_Find :	return(1);
X		case XK_Insert:	return(2);
X		case XK_Delete:	return(3);
X		case DXK_Remove: return(3);
X		case XK_Select:	return(4);
X		case XK_Prior:	return(5);
X		case XK_Next:	return(6);
X		default:	return(-1);
X	}
X}
X
X
Xstatic int sunfuncvalue (keycode)
X	int keycode;
X  {
X  	switch (keycode) {
X		case XK_F1:	return(224);
X		case XK_F2:	return(225);
X		case XK_F3:	return(226);
X		case XK_F4:	return(227);
X		case XK_F5:	return(228);
X		case XK_F6:	return(229);
X		case XK_F7:	return(230);
X		case XK_F8:	return(231);
X		case XK_F9:	return(232);
X		case XK_F10:	return(233);
X		case XK_F11:	return(192);
X		case XK_F12:	return(193);
X		case XK_F13:	return(194);
X		case XK_F14:	return(195);
X		case XK_F15:	return(196);
X		case XK_Help:	return(196);
X		case XK_F16:	return(197);
X		case XK_Menu:	return(197);
X		case XK_F17:	return(198);
X		case XK_F18:	return(199);
X		case XK_F19:	return(200);
X		case XK_F20:	return(201);
X
X		case XK_R1:	return(208);
X		case XK_R2:	return(209);
X		case XK_R3:	return(210);
X		case XK_R4:	return(211);
X		case XK_R5:	return(212);
X		case XK_R6:	return(213);
X		case XK_R7:	return(214);
X		case XK_R8:	return(215);
X		case XK_R9:	return(216);
X		case XK_R10:	return(217);
X		case XK_R11:	return(218);
X		case XK_R12:	return(219);
X		case XK_R13:	return(220);
X		case XK_R14:	return(221);
X		case XK_R15:	return(222);
X  
X		case XK_Find :	return(1);
X		case XK_Insert:	return(2);
X		case XK_Delete:	return(3);
X		case DXK_Remove: return(3);
X		case XK_Select:	return(4);
X		case XK_Prior:	return(5);
X		case XK_Next:	return(6);
X		default:	return(-1);
X	}
X}
X
END_OF_FILE
if test 7268 -ne `wc -c <'xterm/input.c'`; then
    echo shar: \"'xterm/input.c'\" unpacked with wrong size!
fi
# end of 'xterm/input.c'
fi
if test -f 'xterm/tabs.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xterm/tabs.c'\"
else
echo shar: Extracting \"'xterm/tabs.c'\" \(2605 characters\)
sed "s/^X//" >'xterm/tabs.c' <<'END_OF_FILE'
X/*
X *	$XConsortium: tabs.c,v 1.2 88/09/06 17:08:36 jim Exp $
X */
X
X#ifndef lint
Xstatic char *rcsid_tabs_c = "$XConsortium: tabs.c,v 1.2 88/09/06 17:08:36 jim Exp $";
X#endif	/* lint */
X
X#include <X11/copyright.h>
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.
X *
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X
X/* tabs.c */
X
X#ifndef lint
Xstatic char rcs_id[] = "$XConsortium: tabs.c,v 1.2 88/09/06 17:08:36 jim Exp $";
X#endif	/* lint */
X
X#include <X11/Xlib.h>
X#include "ptyx.h"
X/*
X * This file presumes 32bits/word.  This is somewhat of a crock, and should
X * be fixed sometime.
X */
X
X/*
X * places tabstops at only every 8 columns
X */
XTabReset(tabs)
XTabs	tabs;
X{
X	register int i;
X
X	for (i=0; i<TAB_ARRAY_SIZE; ++i)
X		tabs[i] = 0;
X
X	for (i=0; i<MAX_TABS; i+=8)
X		TabSet(tabs, i);
X}	
X
X
X/*
X * places a tabstop at col
X */
XTabSet(tabs, col)
XTabs	tabs;
X{
X	tabs[col >> 5] |= (1 << (col & 31));
X}
X
X/*
X * clears a tabstop at col
X */
XTabClear(tabs, col)
XTabs	tabs;
X{
X	tabs[col >> 5] &= ~(1 << (col & 31));
X}
X
X/*
X * returns the column of the next tabstop
X * (or MAX_TABS - 1 if there are no more).
X * A tabstop at col is ignored.
X */
XTabNext (tabs, col)
XTabs	tabs;
X{
X	extern XtermWidget term;
X	register TScreen *screen = &term->screen;
X
X	if(screen->curses && screen->do_wrap && (term->flags & WRAPAROUND)) {
X		Index(screen, 1);
X		col = screen->cur_col = screen->do_wrap = 0;
X	}
X	for (++col; col<MAX_TABS; ++col)
X		if (tabs[col >> 5] & (1 << (col & 31)))
X			return (col);
X
X	return (MAX_TABS - 1);
X}
X
X/*
X * clears all tabs
X */
XTabZonk (tabs)
XTabs	tabs;
X{
X	register int i;
X
X	for (i=0; i<TAB_ARRAY_SIZE; ++i)
X		tabs[i] = 0;
X}
END_OF_FILE
if test 2605 -ne `wc -c <'xterm/tabs.c'`; then
    echo shar: \"'xterm/tabs.c'\" unpacked with wrong size!
fi
# end of 'xterm/tabs.c'
fi
if test -f 'xterm/x10ctlseq.ms' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xterm/x10ctlseq.ms'\"
else
echo shar: Extracting \"'xterm/x10ctlseq.ms'\" \(14340 characters\)
sed "s/^X//" >'xterm/x10ctlseq.ms' <<'END_OF_FILE'
X.\"#! troff -Q -ms $1
X.\" This is the "Xterm Control Sequences" document, written by
X.\"	Edward Moy
X.\"	Academic Computing Services
X.\"	University of California
X.\"	Berkeley, CA  94720
X.\"
X.\"	edmoy@opal.Berkeley.EDU
X.\"	ucbvax!opal!edmoy
X.\"
X.\" Run this file through troff and use the -ms macro package.
X.ND
X.de St
X.sp
X.nr PD 0
X.nr PI 1.5i
X.nr VS 16
X..
X.de Ed
X.nr PD .3v
X.nr VS 12
X..
X.rm CH
X.ds LH Xterm Control Sequences
X.nr s 6*\n(PS/10
X.ds L \s\nsBEL\s0
X.ds E \s\nsESC\s0
X.ds T \s\nsTAB\s0
X.ds X \s\nsETX\s0
X.ds N \s\nsENQ\s0
X.ds e \s\nsETB\s0
X.ds C \s\nsCAN\s0
X.ds S \s\nsSUB\s0
X.nr [W \w'\*L'u
X.nr w \w'\*E'u
X.if \nw>\n([W .nr [W \nw
X.nr w \w'\*T'u
X.if \nw>\n([W .nr [W \nw
X.nr w \w'\*X'u
X.if \nw>\n([W .nr [W \nw
X.nr w \w'\*N'u
X.if \nw>\n([W .nr [W \nw
X.nr w \w'\*e'u
X.if \nw>\n([W .nr [W \nw
X.nr w \w'\*C'u
X.if \nw>\n([W .nr [W \nw
X.nr w \w'\*S'u
X.if \nw>\n([W .nr [W \nw
X.nr [W +\w'\|\|'u
X.de []
X.nr w \w'\\$2'
X.nr H \\n([Wu-\\nwu
X.nr h \\nHu/2u
X.ds \\$1 \(br\v'-1p'\(br\v'1p'\h'\\nhu'\\$2\h'\\nHu-\\nhu'\(br\l'-\\n([Wu\(ul'\v'-1p'\(br\l'-\\n([Wu\(rn'\v'1p'\|
X..
X.[] Et \v'-1p'\*X\v'1p'
X.[] En \v'-1p'\*N\v'1p'
X.[] Be \v'-1p'\*L\v'1p'
X.[] Bs \v'-1p'\s\nsBS\s0\v'1p'
X.[] Ta \v'-1p'\*T\v'1p'
X.[] Lf \v'-1p'\s\nsLF\s0\v'1p'
X.[] Vt \v'-1p'\s\nsVT\s0\v'1p'
X.[] Ff \v'-1p'\s\nsFF\s0\v'1p'
X.[] Cr \v'-1p'\s\nsCR\s0\v'1p'
X.[] So \v'-1p'\s\nsSO\s0\v'1p'
X.[] Si \v'-1p'\s\nsSI\s0\v'1p'
X.[] Eb \v'-1p'\*e\v'1p'
X.[] Ca \v'-1p'\*C\v'1p'
X.[] Su \v'-1p'\*S\v'1p'
X.[] Es \v'-1p'\*E\v'1p'
X.[] Fs \v'-1p'\s\nsFS\s0\v'1p'
X.[] Gs \v'-1p'\s\nsGS\s0\v'1p'
X.[] Rs \v'-1p'\s\nsRS\s0\v'1p'
X.[] Us \v'-1p'\s\nsUS\s0\v'1p'
X.[] # #
X.[] (( (
X.[] ) )
X.[] * *
X.[] + +
X.[] 0 0
X.[] 1 1
X.[] 2 2
X.[] 3 3
X.[] 4 4
X.[] 5 5
X.[] 6 6
X.[] 7 7
X.[] 8 8
X.[] 9 9
X.[] : :
X.[] ; ;
X.[] = =
X.[] > >
X.[] ? ?
X.[] @ @
X.[] A A
X.[] cB B
X.[] C C
X.[] D D
X.[] E E
X.[] F F
X.[] H H
X.[] J J
X.[] K K
X.[] L L
X.[] M M
X.[] N N
X.[] O O
X.[] P P
X.[] R R
X.[] S S
X.[] T T
X.[] [[ [
X.[] ] ]
X.[] ` \`
X.[] a a
X.[] b b
X.[] c c
X.[] d d
X.[] f f
X.[] g g
X.[] h h
X.[] i i
X.[] j j
X.[] k k
X.[] l l
X.[] m m
X.[] n n
X.[] p p
X.[] q q
X.[] r r
X.[] s s
X.[] t t
X.[] x x
X.ds Cc \fIC\fP
X.ds Ps \fIP\v'.3m'\h'-.2m'\s-2s\s0\v'-.3m'\fP
X.ds Pm \fIP\v'.3m'\h'-.2m'\s-2m\s0\v'-.3m'\fP
X.ds Pt \fIP\v'.3m'\h'-.2m'\s-2t\s0\v'-.3m'\fP
X.ds Ix \fIx\fP
X.ds Iy \fIy\fP
X.ds Iw \fIw\fP
X.ds Ih \fIh\fP
X.ds Ir \fIr\fP
X.ds Ic \fIc\fP
X.nr LL 6.5i
X.TL
XXterm Control Sequences
X.am NP
X.ds CF %
X..
X.SH
XDefinitions
X.IP \*(Cc
XA single (required) character.
X.IP \*(Ps
XA single (usually optional) numeric parameter, composed of one of more digits.
X.IP \*(Pm
XA multiple numeric parameter composed of any number of single numeric
Xparameters, separated by \*; character(s).
X.IP \*(Pt
XA text parameter composed of printable characters.
X.SH
XVT102 Mode
X.ds RH VT102 Mode
X.LP
XMost of these control sequences are standard VT102 control sequences.
XThere are, however, additional ones to provide control of
X.I xterm
Xdependent functions, like the scrollbar or window size.
X.St
X.IP \\*(Be
XBell (Ctrl-G)
X.IP \\*(Bs
XBackspace (Ctrl-H)
X.IP \\*(Ta
XHorizontal Tab (Ctrl-I)
X.IP \\*(Lf
XLine Feed or New Line (Ctrl-J)
X.IP \\*(Vt
XVertical Tab (Ctrl-K)
X.IP \\*(Ff
XForm Feed or New Page (Ctrl-L)
X.IP \\*(Cr
XCarriage Return (Ctrl-M)
X.IP \\*(So
XShift Out (Ctrl-N) \(-> Switch to Alternate Character Set
X.IP \\*(Si
XShift In (Ctrl-O) \(-> Switch to Standard Character Set
X.IP \\*(Es\\*#\\*8
XDEC Screen Alignment Test (DECALN)
X.IP \\*(Es\\*(((\\*(Cc
XSelect G0 Character Set (SCS)
X  \*(Cc = \*0 \(-> Special Character and Line Drawing Set
X  \*(Cc = \*1 \(-> Alternate Character ROM Standard Set
X  \*(Cc = \*2 \(-> Alternate Character ROM Special Set
X  \*(Cc = \*A \(-> United Kingdom (UK)
X  \*(Cc = \*(cB \(-> United States (USASCII)
X.IP \\*(Es\\*)\\*(Cc
XSelect G1 Character Set (SCS)
X  \*(Cc = \*0 \(-> Special Character and Line Drawing Set
X  \*(Cc = \*1 \(-> Alternate Character ROM Standard Set
X  \*(Cc = \*2 \(-> Alternate Character ROM Special Set
X  \*(Cc = \*A \(-> United Kingdom (UK)
X  \*(Cc = \*(cB \(-> United States (USASCII)
X.IP \\*(Es\\**\\*(Cc
XSelect G2 Character Set (SCS)
X  \*(Cc = \*0 \(-> Special Character and Line Drawing Set
X  \*(Cc = \*1 \(-> Alternate Character ROM Standard Set
X  \*(Cc = \*2 \(-> Alternate Character ROM Special Set
X  \*(Cc = \*A \(-> United Kingdom (UK)
X  \*(Cc = \*(cB \(-> United States (USASCII)
X.IP \\*(Es\\*+\\*(Cc
XSelect G3 Character Set (SCS)
X  \*(Cc = \*0 \(-> Special Character and Line Drawing Set
X  \*(Cc = \*1 \(-> Alternate Character ROM Standard Set
X  \*(Cc = \*2 \(-> Alternate Character ROM Special Set
X  \*(Cc = \*A \(-> United Kingdom (UK)
X  \*(Cc = \*(cB \(-> United States (USASCII)
X.IP \\*(Es\\*7
XSave Cursor (DECSC)
X.IP \\*(Es\\*8
XRestore Cursor (DECRC)
X.IP \\*(Es\\*=
XApplication Keypad (DECPAM)
X.IP \\*(Es\\*>
XNormal Keypad (DECPNM)
X.IP \\*(Es\\*D
XIndex (IND)
X.IP \\*(Es\\*E
XNext Line (NEL)
X.IP \\*(Es\\*H
XTab Set (HTS)
X.IP \\*(Es\\*M
XReverse Index (RI)
X.IP \\*(Es\\*N
XSingle Shift Select of G2 Character Set (SS2)
X.IP \\*(Es\\*O
XSingle Shift Select of G3 Character Set (SS3)
X.IP \\*(Es\\*([[\\*(Ps\|\\*@
XInsert \*(Ps (Blank) Character(s) (default = 1) (ICH)
X.IP \\*(Es\\*([[\\*(Ps\|\\*A
XCursor Up \*(Ps Times (default = 1) (CUU)
X.IP \\*(Es\\*([[\\*(Ps\|\\*(cB
XCursor Down \*(Ps Times (default = 1) (CUD)
X.IP \\*(Es\\*([[\\*(Ps\|\\*C
XCursor Forward \*(Ps Times (default = 1) (CUF)
X.IP \\*(Es\\*([[\\*(Ps\|\\*D
XCursor Backward \*(Ps Times (default = 1) (CUB)
X.IP \\*(Es\\*([[\\*(Ps\|\\*;\\*(Ps\|\\*H
XCursor Position [row;column] (default = [1,1]) (CUP)
X.IP \\*(Es\\*([[\\*(Ps\|\\*J
XErase in Display (ED)
X  \*(Ps = \*0 \(-> Clear Below (default)
X  \*(Ps = \*1 \(-> Clear Above
X  \*(Ps = \*2 \(-> Clear All
X.IP \\*(Es\\*([[\\*(Ps\|\\*K
XErase in Line (EL)
X  \*(Ps = \*0 \(-> Clear to Right (default)
X  \*(Ps = \*1 \(-> Clear to Left
X  \*(Ps = \*2 \(-> Clear All
X.IP \\*(Es\\*([[\\*(Ps\|\\*L
XInsert \*(Ps Line(s) (default = 1) (IL)
X.IP \\*(Es\\*([[\\*(Ps\|\\*M
XDelete \*(Ps Line(s) (default = 1) (DL)
X.IP \\*(Es\\*([[\\*(Ps\|\\*P
XDelete \*(Ps Character(s) (default = 1) (DCH)
X.IP \\*(Es\\*([[\\*(Ps\|\\*c
XDevice Atrributes (DA1)
X.IP \\*(Es\\*([[\\*(Ps\|\\*;\\*(Ps\|\\*f
XCursor Position [row;column] (default = [1,1]) (HVP)
X.IP \\*(Es\\*([[\\*(Ps\|\\*g
XTab Clear
X  \*(Ps = \*0 \(-> Clear Current Column (default)
X  \*(Ps = \*3 \(-> Clear All
X.IP \\*(Es\\*([[\\*(Ps\|\\*h
XMode Set (SET)
X  \*(Ps = \*4 \(-> Insert Mode (IRM)
X  \*(Ps = \*2\*0 \(-> Automatic Linefeed (LNM)
X.IP \\*(Es\\*([[\\*(Ps\|\\*l
XMode Reset (RST)
X  \*(Ps = \*4 \(-> Insert Mode (IRM)
X  \*(Ps = \*2\*0 \(-> Automatic Linefeed (LNM)
X.IP \\*(Es\\*([[\\*(Pm\|\\*m
XCharacter Attributes (SGR)
X  \*(Ps = \*0 \(-> Normal (default)
X  \*(Ps = \*1 \(-> Blink (appears as Bold)
X  \*(Ps = \*4 \(-> Underscore
X  \*(Ps = \*5 \(-> Bold
X  \*(Ps = \*7 \(-> Inverse
X.IP \\*(Es\\*([[\\*(Ps\|\\*n
XDevice Status Report (DSR)
X  \*(Ps = 5 \(-> Status Report \*(Es\*([[\*0\*n \(-> OK
X  \*(Ps = 6 \(-> Report Cursor Position (CPR) [row;column] as
X\*(Es\*([[\*(Ir\|\*;\*(Ic\|\*R
X.IP \\*(Es\\*([[\\*(Ps\|\\*;\\*(Ps\|\\*r
XSet Scrolling Region [top;bottom] (default = full size of window) (DECSTBM)
X.IP \\*(Es\\*([[\\*(Pm\|\\*t
XSun TTY Emulation
X  \*(Pm = \*3\*;\*(Ix\|\*;\*(Iy \(-> Move Window to (\*(Ix, \*(Iy)
X  \*(Pm = \*4\*;\*(Iw\|\*;\*(Ih \(-> Resize Window, Width \*(Iw, Height \*(Ih
Xin Pixels
X  \*(Pm = \*5 \(-> Raise Window
X  \*(Pm = \*6 \(-> Lower Window
X  \*(Pm = \*7 \(-> Redraw Window
X  \*(Pm = \*8\*;\*(Ir\|\*;\*(Ic \(-> Resize Window, \*(Ir Rows, \*(Ic Columns
X  \*(Pm = \*1\*3 \(-> Send Window Position as
X\*(Es\*([[\*3\*;\*(Ix\|\*;\*(Iy\|\*t
X  \*(Pm = \*1\*4 \(-> Send Window Size in Pixels as
X\*(Es\*([[\*4\*;\*(Iw\|\*;\*(Ih\|\*t
X  \*(Pm = \*1\*8 \(-> Send Window Size in Rows and Columns as
X\*(Es\*([[\*8\*;\*(Ir\|\*;\*(Ic\|\*t
X.IP \\*(Es\\*([[\\*(Ps\|\\*x
XRequest Terminal Parameters (DECREQTPARM)
X.IP \\*(Es\\*([[\\*?\\*E
XErase Status Line
X.IP \\*(Es\\*([[\\*?\\*F
XReturn from Status Line
X.IP \\*(Es\\*([[\\*?\\*H
XHide Status Line
X.IP \\*(Es\\*([[\\*?\\*S
XShow Status Line
X.IP \\*(Es\\*([[\\*?\\*(Ps\|\\*T
XGo To Column \*(Ps of Status Line
X.IP \\*(Es\\*([[\\*?\\*(Ps\|\\*h
XDEC Private Mode Set (DECSET)
X  \*(Ps = \*1 \(-> Application Cursor Keys (DECCKM)
X  \*(Ps = \*3 \(-> 132 Column Mode (DECCOLM)
X  \*(Ps = \*4 \(-> Smooth (Slow) Scroll (DECSCLM)
X  \*(Ps = \*5 \(-> Reverse Video (DECSCNM)
X  \*(Ps = \*6 \(-> Origin Mode (DECOM)
X  \*(Ps = \*7 \(-> Wraparound Mode (DECAWM)
X  \*(Ps = \*8 \(-> Auto-repeat Keys (DECARM)
X  \*(Ps = \*9 \(-> Send MIT Mouse Row & Column on Button Press
X  \*(Ps = \*3\*8 \(-> Enter TekTronix Mode (DECTEK)
X  \*(Ps = \*4\*0 \(-> Allow 80 \z\(<-\(-> 132 Mode
X  \*(Ps = \*4\*1 \(-> \fIcurses\fP(5) fix
X  \*(Ps = \*4\*2 \(-> Show Scrollbar
X  \*(Ps = \*4\*3 \(-> Save Lines Scrolled of Top of Window
X  \*(Ps = \*4\*4 \(-> Turn On Margin Bell
X  \*(Ps = \*4\*5 \(-> Reverse-wraparound Mode
X  \*(Ps = \*4\*6 \(-> Start Logging
X  \*(Ps = \*4\*7 \(-> Use Alternate Screen Buffer
X  \*(Ps = \*4\*8 \(-> Reverse Status Line
X  \*(Ps = \*4\*9 \(-> Page Scroll Mode
X.IP \\*(Es\\*([[\\*?\\*(Ps\|\\*l
XDEC Private Mode Reset (DECRST)
X  \*(Ps = \*1 \(-> Normal Cursor Keys (DECCKM)
X  \*(Ps = \*3 \(-> 80 Column Mode (DECCOLM)
X  \*(Ps = \*4 \(-> Jump (Fast) Scroll (DECSCLM)
X  \*(Ps = \*5 \(-> Normal Video (DECSCNM)
X  \*(Ps = \*6 \(-> Normal Cursor Mode (DECOM)
X  \*(Ps = \*7 \(-> No Wraparound Mode (DECAWM)
X  \*(Ps = \*8 \(-> No Auto-repeat Keys (DECARM)
X  \*(Ps = \*9 \(-> Don't Send MIT Mouse Row & Column on Button Press
X  \*(Ps = \*4\*0 \(-> Disallow 80 \z\(<-\(-> 132 Mode
X  \*(Ps = \*4\*1 \(-> No \fIcurses\fP(5) fix
X  \*(Ps = \*4\*2 \(-> Hide Scrollbar
X  \*(Ps = \*4\*3 \(-> Don't Save Lines Scrolled of Top of Window
X  \*(Ps = \*4\*4 \(-> Turn Off Margin Bell
X  \*(Ps = \*4\*5 \(-> No Reverse-wraparound Mode
X  \*(Ps = \*4\*6 \(-> Stop Logging
X  \*(Ps = \*4\*7 \(-> Use Normal Screen Buffer
X  \*(Ps = \*4\*8 \(-> Un-reverse Status Line
X  \*(Ps = \*4\*9 \(-> Normal Scroll Mode
X.IP \\*(Es\\*([[\\*?\\*(Ps\|\\*r
XRestore DEC Private Mode
X  \*(Ps = \*1 \(-> Normal/Application Cursor Keys (DECCKM)
X  \*(Ps = \*3 \(-> 80/132 Column Mode (DECCOLM)
X  \*(Ps = \*4 \(-> Jump (Fast)/Smooth (Slow) Scroll (DECSCLM)
X  \*(Ps = \*5 \(-> Normal/Reverse Video (DECSCNM)
X  \*(Ps = \*6 \(-> Normal/Origin Cursor Mode (DECOM)
X  \*(Ps = \*7 \(-> No Wraparound/Wraparound Mode (DECAWM)
X  \*(Ps = \*8 \(-> Auto-repeat/No Auto-repeat Keys (DECARM)
X  \*(Ps = \*9 \(-> Don't Send/Send MIT Mouse Row & Column on Button Press
X  \*(Ps = \*4\*0 \(-> Disallow/Allow 80 \z\(<-\(-> 132 Mode
X  \*(Ps = \*4\*1 \(-> Off/On \fIcurses\fP(5) fix
X  \*(Ps = \*4\*2 \(-> Hide/Show Scrollbar
X  \*(Ps = \*4\*3 \(-> Don't Save/Save Lines Scrolled of Top of Window
X  \*(Ps = \*4\*4 \(-> Turn Off/On Margin Bell
X  \*(Ps = \*4\*5 \(-> No Reverse-wraparound/Reverse-wraparound Mode
X  \*(Ps = \*4\*6 \(-> Stop/Start Logging
X  \*(Ps = \*4\*7 \(-> Use Normal/Alternate Screen Buffer
X  \*(Ps = \*4\*8 \(-> Un-reverse/Reverse Status Line
X  \*(Ps = \*4\*9 \(-> Normal/Page Scroll Mode
X.IP \\*(Es\\*([[\\*?\\*(Ps\|\\*s
XSave DEC Private Mode
X  \*(Ps = \*1 \(-> Normal/Application Cursor Keys (DECCKM)
X  \*(Ps = \*3 \(-> 80/132 Column Mode (DECCOLM)
X  \*(Ps = \*4 \(-> Jump (Fast)/Smooth (Slow) Scroll (DECSCLM)
X  \*(Ps = \*5 \(-> Normal/Reverse Video (DECSCNM)
X  \*(Ps = \*6 \(-> Normal/Origin Cursor Mode (DECOM)
X  \*(Ps = \*7 \(-> No Wraparound/Wraparound Mode (DECAWM)
X  \*(Ps = \*8 \(-> Auto-repeat/No Auto-repeat Keys (DECARM)
X  \*(Ps = \*9 \(-> Don't Send/Send MIT Mouse Row & Column on Button Press
X  \*(Ps = \*4\*0 \(-> Disallow/Allow 80 \z\(<-\(-> 132 Mode
X  \*(Ps = \*4\*1 \(-> Off/On \fIcurses\fP(5) fix
X  \*(Ps = \*4\*2 \(-> Hide/Show Scrollbar
X  \*(Ps = \*4\*3 \(-> Don't Save/Save Lines Scrolled of Top of Window
X  \*(Ps = \*4\*4 \(-> Turn Off/On Margin Bell
X  \*(Ps = \*4\*5 \(-> No Reverse-wraparound/Reverse-wraparound Mode
X  \*(Ps = \*4\*6 \(-> Stop/Start Logging
X  \*(Ps = \*4\*7 \(-> Use Normal/Alternate Screen Buffer
X  \*(Ps = \*4\*8 \(-> Un-reverse/Reverse Status Line
X  \*(Ps = \*4\*9 \(-> Normal/Page Scroll Mode
X.IP \\*(Es\\*]\\*(Ps\|\\*;\\*(Pt\|\\*(Be
XSet Text Parameters
X  \*(Ps = \*0 \(-> Change Window Name and Title to \*(Pt
X  \*(Ps = \*4\*6 \(-> Change Log File to \*(Pt
X.IP \\*(Es\\*c
XFull Reset (RIS)
X.Ed
X.SH
XTektronix 4015 Mode
X.ds RH Tektronix 4015 Mode
X.LP
XMost of these sequences are standard Tektronix 4015 control sequences.
XThe major features missing are the alternate (APL) character set and
Xthe write-thru and defocused modes.
X.St
X.IP \\*(Be
XBell (Ctrl-G)
X.IP \\*(Bs
XBackspace (Ctrl-H)
X.IP \\*(Ta
XHorizontal Tab (Ctrl-I)
X.IP \\*(Lf
XLine Feed or New Line (Ctrl-J)
X.IP \\*(Vt
XVertical Tab (Ctrl-K)
X.IP \\*(Ff
XForm Feed or New Page (Ctrl-L)
X.IP \\*(Cr
XCarriage Return (Ctrl-M)
X.IP \\*(Es\\*(Et
XSwitch to VT102 Mode
X.IP \\*(Es\\*(En
XReturn Terminal Status
X.IP \\*(Es\\*(Lf
XPAGE (Clear Screen)
X.IP \\*(Es\\*(Eb
XCOPY (Save Tektronix Codes to File)
X.IP \\*(Es\\*(Ca
XBypass Condition
X.IP \\*(Es\\*(Su
XGIN mode
X.IP \\*(Es\\*(Fs
XSpecial Point Plot Mode
X.IP \\*(Es\\*(Gs
XGraph Mode (same as \*(Gs)
X.IP \\*(Es\\*(Rs
XIncremental Plot Mode (same as \*(Rs)
X.IP \\*(Es\\*(Us
XAlpha Mode (same as \*(Us)
X.IP \\*(Es\\*8
XSelect Large Character Set
X.IP \\*(Es\\*9
XSelect #2 Character Set
X.IP \\*(Es\\*:
XSelect #3 Character Set
X.IP \\*(Es\\*;
XSelect Small Character Set
X.IP \\*(Es\\*]\\*(Ps\|\\*;\\*(Pt\|\\*(Be
XSet Text Parameters
X  \*(Ps = \*0 \(-> Change Window Name and Title to \*(Pt
X  \*(Ps = \*4\*6 \(-> Change Log File to \*(Pt
X.IP \\*(Es\\*`
XNormal Z Axis and Normal (solid) Vectors
X.IP \\*(Es\\*a
XNormal Z Axis and Dotted Line Vectors
X.IP \\*(Es\\*b
XNormal Z Axis and Dot-Dashed Vectors
X.IP \\*(Es\\*c
XNormal Z Axis and Short-Dashed Vectors
X.IP \\*(Es\\*d
XNormal Z Axis and Long-Dashed Vectors
X.IP \\*(Es\\*h
XDefocused Z Axis and Normal (solid) Vectors
X.IP \\*(Es\\*i
XDefocused Z Axis and Dotted Line Vectors
X.IP \\*(Es\\*j
XDefocused Z Axis and Dot-Dashed Vectors
X.IP \\*(Es\\*k
XDefocused Z Axis and Short-Dashed Vectors
X.IP \\*(Es\\*l
XDefocused Z Axis and Long-Dashed Vectors
X.IP \\*(Es\\*p
XWrite-Thru Mode and Normal (solid) Vectors
X.IP \\*(Es\\*q
XWrite-Thru Mode and Dotted Line Vectors
X.IP \\*(Es\\*r
XWrite-Thru Mode and Dot-Dashed Vectors
X.IP \\*(Es\\*s
XWrite-Thru Mode and Short-Dashed Vectors
X.IP \\*(Es\\*t
XWrite-Thru Mode and Long-Dashed Vectors
X.IP \\*(Fs
XPoint Plot Mode
X.IP \\*(Gs
XGraph Mode
X.IP \\*(Rs
XIncremental Plot Mode
X.IP \\*(Us
XAlpha Mode
X.Ed
X
END_OF_FILE
if test 14340 -ne `wc -c <'xterm/x10ctlseq.ms'`; then
    echo shar: \"'xterm/x10ctlseq.ms'\" unpacked with wrong size!
fi
# end of 'xterm/x10ctlseq.ms'
fi
echo shar: End of archive 13 \(of 14\).
cp /dev/null ark13isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 14 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
dan
----------------------------------------------------
O'Reilly && Associates   argv@sun.com / argv@ora.com
Opinions expressed reflect those of the author only.