[comp.os.os9] SCREEN for OSK, Part 01 of 03

ocker@lan.informatik.tu-muenchen.dbp.de (Wolfgang Ocker) (01/25/89)

Here are the sources of SCREEN. A man page is included.

To run SCREEN you have to install the PTY driver posted some
weeks ago.

Have fun,
/// Wolfgang Ocker

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 3)."
# Contents:  README MANIFEST wait_nw.c Makefile select.c screen.h
#   screen.man
# Wrapped by weo@recco on Fri Jan  6 14:31:44 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(5133 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
X"screen" is a window manager that allows you to handle several independent
Xscreens (UNIX ttys) on a single physical terminal; each screen has its own
Xset of processes connected to it (typically interactive shells).  Each
Xvirtual terminal created by "screen" emulates a DEC VT100 plus several ANSI
XX3.64 functions (including DEC VT102 features such as line and character
Xdeletion and insertion).
X
XSince "screen" uses pseudo-ttys, the select system call, and UNIX-domain
Xsockets, it will not run under a system that does not include these
Xfeatures of 4.2 and 4.3 BSD UNIX.
X
X[ It's also available for OS-9/68000 with the PTYs from reccoware
X  systems. Instead of the socket a named pipe is used. The select system
X  call is emulated with _gs_rdy() and _ss_signl() calls.  /// weo]
X
XIf you want to get a quick idea how "screen" works but don't want to read
Xthe entire manual, do the following:
X 
X     -  call "screen" without arguments
X     -  wait for the shell prompt; execute some commands
X     -  type ^A ^C (Control-A followed by Control-C)
X     -  wait for the shell prompt; do something in the new window
X     -  type ^A ^A repeatedly to switch between the two windows
X     -  terminate the first shell ("screen" switches to the other window)
X     -  terminate the second shell
X
XIf you have got "vttest" (the VT100 test program from mod.sources) you
Xmay want to run it from within "screen" to verify that it correctly
Xemulates a VT100 on your terminal (except for 132 column mode and
Xdouble width/height characters, of course).
X
XBy the way, "screen" can be used to compensate for certain bugs of "real"
XVT100 terminals.  For instance, our 4.2 BSD version of mille(6) garbles
Xthe display on terminals of the VT100 family, but it works quite fine
Xwhen it is invoked from within "screen".  In addition, "screen" enables
Xyou to use EMACS on terminals that are unable to generate Control-S and
XControl-Q from the keyboard or that require flow control using Control-S
Xand Control-Q.  This is the reason why I have an alias like
X     alias emacs "screen emacs"
Xin my .cshrc file.
X
X
XI have published a beta-test release of screen in the non-moderated
Xsources newsgroup four months ago.  Since then I have received numerous
Xsuggestions for enhancements and improvements, many of which I have
Xincluded in this release of "screen".  One person reported that screen
Xdoes not work correctly on the Ann Arbor Guru-XL; I have not been able
Xto track the problem down without having more detailed information than
Xjust the termcap entry.
X
XMajor changes between this and the beta-test release are:
X
X    -  "screen" now creates an entry in /etc/utmp for each virtual
X       terminal
X
X       [ Not supported in OSK version /// weo]
X
X    -  the owner of the tty file for a virtual terminal is set properly
X       (provided that "screen" is set-uid with owner root)
X    -  the -c option has been eliminated; you can now start a command
X       in a new window with "screen [cmd [args]]"
X    -  a (user-settable) notification can be displayed in the current
X       window's message line when the bell is rung in a background window
X    -  a "chdir" command can be placed into ".screenrc" to facilitate
X       creation of windows in specific directories
X    -  flow control can be disabled by means of a command line option or
X       a special termcap symbol (necessary for EMACS)
X    -  "C-a s" and "C-a q" can be used to send a Control-S or a Control-Q,
X       respectively (for certain terminals)
X    -  it is no longer necessary to specify the full pathname when a
X       command is started in a new window (and with the "bind" command)
X    -  "C-a ." can be used to write the current termcap entry to a file
X       (useful for "rlogin" which does not propagate TERMCAP)
X    -  "C-a C-t" displays status information (e.g. the load average and
X       the virtual terminal's parameters) in the message line
X
X       [ Load average not displayed in OSK version.  /// weo]
X
X    -  "C-a C-\" closes all windows and terminates screen
X
XBefore typing "make", you should have a look into the Makefile.
XIf your system maintains a 4.3-BSD-style load average, add -DLOADAV to
Xthe compiler options.  In addition, you must set -DGETTTYENT if your
Xsystem has the new format /etc/ttys and the getttyent(3) routines.
X
X"screen" should be granted read and write access to /etc/utmp and, if
X-DLOADAV has been specified, read access to /vmunix and /dev/kmem.
X"screen" should be installed with set-uid and owner root to enable it
Xto correctly change the owner of newly allocated virtual terminals.
XFailing to do this (e.g. if you fear a trojan horse) doesn't have any
Xmajor disadvantages, except that w(1) and some other utilities may have
Xsome problems with the tty files of your virtual terminals.
X
X
XHave fun,
X    Oliver Laumann
X    Technical University of Berlin,
X    Communications and Operating Systems Research Group.
X
X    net@tub.BITNET     US: pyramid!tub!net     Europe: unido!tub!net
X
X
XOSK Version by reccoware systems, Wolfgang Ocker, Puchheim, 1988
X               Lochhauserstrasse 35a
X               D-8039 Puchheim
X
X    weo@recco  weo%recco@tmpmbx  weo@altger
END_OF_FILE
if test 5133 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'MANIFEST'\"
else
echo shar: Extracting \"'MANIFEST'\" \(375 characters\)
sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
X   File Name		Archive #	Description
X-----------------------------------------------------------
X MANIFEST                   1	
X Makefile                   1	
X README                     1	
X ansi.c                     2	
X screen.c                   3	
X screen.h                   1	
X screen.man                 1	
X select.c                   1	
X wait_nw.c                  1	
END_OF_FILE
if test 375 -ne `wc -c <'MANIFEST'`; then
    echo shar: \"'MANIFEST'\" unpacked with wrong size!
fi
# end of 'MANIFEST'
fi
if test -f 'wait_nw.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'wait_nw.c'\"
else
echo shar: Extracting \"'wait_nw.c'\" \(411 characters\)
sed "s/^X//" >'wait_nw.c' <<'END_OF_FILE'
X#include <stdio.h>
X#include <procid.h>
X
X/*
X * w a i t _ n w
X */
Xint wait_nw(pid, status)
X  register int pid;
X  register int *status;
X{
X  static procid procid;
X  int           tmp;
X
X  if (_get_process_desc(pid, sizeof(procid), &procid) == -1)
X    return(pid);
X  
X  if (procid._state & 0x0100) {
X    while (wait(&tmp) != pid) ;
X    if (status != NULL)
X      *status = tmp;
X    return(pid);
X  }
X  
X  return(-1);
X}
END_OF_FILE
if test 411 -ne `wc -c <'wait_nw.c'`; then
    echo shar: \"'wait_nw.c'\" unpacked with wrong size!
fi
# end of 'wait_nw.c'
fi
if test -f 'Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(829 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X# The following options can be set:
X#
X# -DLOADAV    -- your system maintains a load average like 4.3 BSD does
X#                (an array of three doubles called _avenrun; it is read
X#                from /dev/kmem; _avenrun is taken from the namelist of
X#                /vmunix).  Don't set this on a Sun.
X# -DGETTTYENT -- your system has the new format /etc/ttys (like 4.3 BSD)
X#                and the getttyent(3) library functions.
X#
X# You should install as set-uid with owner root, so that it can read/write
X# /etc/utmp, read /dev/kmem, and chown/chmod the allocated pseudo-ttys.
X
XOPTIONS= 
XCFLAGS = -t=/dd  -m=2 
XRDIR  = RELS
X
XCFILES= screen.c ansi.c select.c wait_nw.c
XOFILES= screen.r ansi.r select.r wait_nw.r
X
Xscreen: $(OFILES)
X  chd $(RDIR); cc $(CFLAGS) -f=screen $(OFILES) -l=/h0/LIB/os9lib.l -l=/h0/LIB/termlib.l
X
END_OF_FILE
if test 829 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'select.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'select.c'\"
else
echo shar: Extracting \"'select.c'\" \(920 characters\)
sed "s/^X//" >'select.c' <<'END_OF_FILE'
X#include <stdio.h>
X#include <modes.h>
X#include <errno.h>
X
X#define READY_SIG 222
X
Xstatic gotchar = 0;
X
Xvoid charget()
X{
X/*	signal(READY_SIG, charget); */
X	gotchar = 1;
X}
X	
Xint select(nfds, sm_rd, sm_wt, sm_ex)
X	register int 	nfds;
X	register int	*sm_rd;
X	int		*sm_wt, *sm_ex;
X{
X	register int	i;
X	register int 	rd;
X	register int	rdy;
X	static int	init = 0;
X
X	rd     = *sm_rd;
X	*sm_rd = 0;
X
X	if (!init) {
X		init = 1;
X		signal(READY_SIG, charget);
X	}
X
X	while (1) {
X		gotchar = 0;
X		for (i = nfds-1; i >= 0; i--)
X			if (rd & (1 << i)) {
X/*				_ss_rel(i); */
X				rdy = _gs_rdy(i);
X				if (rdy > 0)
X					*sm_rd |= (1 << i);
X				else
X					if (rdy == 0 || errno == E_NOTRDY)
X						_ss_ssig(i, READY_SIG);
X					
X			}
X
X		if (*sm_rd != 0 || *sm_wt != 0)
X			break;
X
X		if (gotchar)
X			continue;
X		tsleep(2);
X		if (gotchar)
X			continue;
X		if (DoWait())
X		  break;
X		if (gotchar)
X			continue;
X		sleep(2);
X	}
X		
X	*sm_ex = 0;
X	return(0);
X}
END_OF_FILE
if test 920 -ne `wc -c <'select.c'`; then
    echo shar: \"'select.c'\" unpacked with wrong size!
fi
# end of 'select.c'
fi
if test -f 'screen.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'screen.h'\"
else
echo shar: Extracting \"'screen.h'\" \(1495 characters\)
sed "s/^X//" >'screen.h' <<'END_OF_FILE'
X/* Copyright (c) 1987, Oliver Laumann, Technical University of Berlin.
X * Not derived from licensed software.
X *
X * Permission is granted to freely use, copy, modify, and redistribute
X * this software, provided that no attempt is made to gain profit from it,
X * the author is not construed to be liable for any results of using the
X * software, alterations are clearly marked as such, and this notice is
X * not modified.
X */
X
Xenum state_t {
X    LIT,         /* Literal input */
X    ESC,         /* Start of escape sequence */
X    STR,         /* Start of control string */
X    TERM,        /* ESC seen in control string */
X    CSI,         /* Reading arguments in "CSI Pn ; Pn ; ... ; XXX" */
X};
X
Xenum string_t {
X    NONE,
X    DCS,         /* Device control string */
X    OSC,         /* Operating system command */
X    APC,         /* Application program command */
X    PM,          /* Privacy message */
X};
X
X#define MAXSTR       128
X
X#define IOSIZE       80
X
Xstruct win {
X    int wpid;
X    int ptyfd;
X    int aflag;
X    char outbuf[IOSIZE];
X    int outlen;
X    char cmd[MAXSTR];
X    char tty[MAXSTR];
X    int slot;
X    char **image;
X    char **attr;
X    int active;
X    int x, y;
X    char LocalAttr;
X    int saved;
X    int Saved_x, Saved_y;
X    char SavedLocalAttr;
X    int top, bot;
X    int wrap;
X    int origin;
X    int insert;
X    int keypad;
X    enum state_t state;
X    enum string_t StringType;
X    char string[MAXSTR];
X    char *stringp;
X    char *tabs;
X    int vbwait;
X    int bell;
X};
END_OF_FILE
if test 1495 -ne `wc -c <'screen.h'`; then
    echo shar: \"'screen.h'\" unpacked with wrong size!
fi
# end of 'screen.h'
fi
if test -f 'screen.man' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'screen.man'\"
else
echo shar: Extracting \"'screen.man'\" \(24002 characters\)
sed "s/^X//" >'screen.man' <<'END_OF_FILE'
X
X
X
X     SCREEN(1)         OS9/68000 V2.1 (2 March 1987)         SCREEN(1)
X
X
X
X     NAME
X          screen - screen manager with VT100/ANSI terminal emulation
X
X     SYNOPSIS
X          ssccrreeeenn [ --aa ] [ --ff ] [ --nn ] [ --ee_x_y ] [ _c_m_d _a_r_g_s ]]
X
X     DESCRIPTION
X          _s_c_r_e_e_n is a full-screen window manager that multiplexes a
X          physical terminal between several processes (typically
X          interactive shells).  Each virtual terminal provides the
X          functions of the DEC VT100 terminal and, in addition,
X          several control functions from the ANSI X3.64 (ISO 6429)
X          standard (e.g. insert/delete line).
X
X          When _s_c_r_e_e_n is called, it creates a single window with a
X          shell; the pathname of the shell is taken from the
X          environment symbol $SHELL; if this is not defined, "/bin/sh"
X          is used.  New windows can be created at any time by calling
X          _s_c_r_e_e_n from within a previously created window.  The program
X          to be started in a newly created window and optional
X          arguments to the program can be supplied when _s_c_r_e_e_n is
X          invoked.  For instance,
X
X               screen csh
X
X          will create a window with a C-Shell and switch to that
X          window.  When the process associated with the currently
X          displayed window terminates (e.g. ^D has been typed to a
X          shell), _s_c_r_e_e_n switches to the previously displayed window;
X          when no more windows are left, _s_c_r_e_e_n exits.
X
X          When "/etc/utmp" is writable by _s_c_r_e_e_n, an appropriate
X          record is written to this file for each window and removed
X          when the window is terminated.
X
X     COMMAND KEYS
X          The standard way to create a new window is to type "C-a c"
X          (the notation "C-x" will be used as a shorthand for
X          Control-x in this manual; x is an arbitrary letter).  "C-a
X          c" creates a new window running a shell and switches to that
X          window immediately, regardless of the state of the process
X          running in the current window.  _S_c_r_e_e_n recognizes several
X          such commands; each command consists of "C-a" followed by a
X          one-letter function.  For convenience, the letter after a
X          "C-a" can be entered both with or without the control key
X          pressed (with the exception of "C-a C-a" and "C-a a"; see
X          below), thus, "C-a c" as well as "C-a C-c" can be used to
X          create a window.
X
X          The following commands are recognized by _s_c_r_e_e_n:
X
X          CC--aa cc or CC--aa CC--cc
X               Create a new window with a shell and switch to that
X               window.
X
X          CC--aa kk or CC--aa CC--kk
X               Kill the current window and switch to the previously
X               displayed window.
X
X
X
X     Page 1                                          (printed 9/22/88)
X
X
X
X
X
X
X     SCREEN(1)         OS9/68000 V2.1 (2 March 1987)         SCREEN(1)
X
X
X
X          CC--aa CC--\\
X               Kill all windows and terminate _s_c_r_e_e_n.
X
X          CC--aa CC--aa
X               Switch to the previously displayed window.
X
X          CC--aa 00 to CC--aa 99
X               Switch to the window with the number 0 (1, 2, .., 9,
X               respectively).  When a new window is established, the
X               first available number from the range 0..9 is assigned
X               to this window.  Thus, the first window can be
X               activated by "C-a 0"; at most 10 windows can be present
X               at any time.
X
X          CC--aa ssppaaccee or CC--aa CC--ssppaaccee or CC--aa nn or CC--aa CC--nn
X               Switch to the next window.  This function can be used
X               repeatedly to cycle through the list of windows.
X               (Control-space is not supported by all terminals.)
X
X          CC--aa pp or CC--aa CC--pp or CC--aa --
X               Switch to the previous window (the opposite of CC--aa
X               ssppaaccee).
X
X          CC--aa ll or CC--aa CC--ll
X               Redisplay the current window.
X
X          CC--aa zz or CC--aa CC--zz
X               Suspend _s_c_r_e_e_n.
X
X          CC--aa hh or CC--aa CC--hh
X               Write a hardcopy of the current window to the file
X               "hardcopy._n" in the window's current directory, where _n
X               is the number of the current window.
X
X          CC--aa .. (Control-a dot)
X               Write the termcap entry for the virtual terminal of the
X               currently active window to the file ".termcap" in the
X               directory "$HOME/.screen".  This termcap entry is
X               identical to the value of the environment symbol
X               TERMCAP that is set up by _s_c_r_e_e_n for each window.
X
X          CC--aa ww or CC--aa CC--ww
X               Display a list of all windows.  For each window, the
X               number of the window and the process that has been
X               started in the window is displayed; the current window
X               is marked with a `*'.
X
X          CC--aa tt or CC--aa CC--tt
X               Print in the message line the time of day, the host
X               name, the load averages over 1, 5, and 15 minutes (if
X               this is available on your system), the cursor position
X               of the current window in the form "(colum,row)"
X               starting with "(0,0)", and an indication if flow
X               control and (for the current window) insert mode,
X               origin mode, wrap mode, and keypad application mode are
X               enabled or not (indicated by a '+' or '-').
X
X          CC--aa vv or CC--aa CC--vv
X
X
X
X     Page 2                                          (printed 9/22/88)
X
X
X
X
X
X
X     SCREEN(1)         OS9/68000 V2.1 (2 March 1987)         SCREEN(1)
X
X
X
X               Display the version.
X
X          CC--aa aa
X               Send the character "C-a" to the processes running in
X               the window.
X
X          CC--aa ss or CC--aa CC--ss
X               Send a Control-s to the program running in the window.
X
X          CC--aa qq or CC--aa CC--qq
X               Send a Control-q to the program running in the window.
X
X
X
X          The --ee option can be used to specify a different command
X          character and a character which, when typed immediately
X          after the command character, generates a literal command
X          character.  The defaults for these two characters are "C-a"
X          and `a'.  (Note that the function to switch to the previous
X          window is actually the command character typed twice; for
X          instance, when _s_c_r_e_e_n is called with the option "--ee]]xx" (or
X          "--ee ]]xx"), this function becomes "]]").
X
X     CUSTOMIZATION
X          When _s_c_r_e_e_n is invoked, it executes initialization commands
X          from the file ".screenrc" in the user's home directory.
X          Commands in ".screenrc" are mainly used to automatically
X          establish a number of windows each time _s_c_r_e_e_n is called,
X          and to bind functions to specific keys.  Each line in
X          ".screenrc" contains one initialization command; lines
X          starting with `#' are ignored.  Commands can have arguments;
X          arguments are separated by tabs and spaces and can be
X          surrounded by single quotes or double quotes.
X
X          The following initialization commands are recognized by
X          _s_c_r_e_e_n:
X
X          eessccaappee _x_y
X
X          Set the command character to _x and the character generating
X          a literal command character to _y (see the -e option above).
X
X          bbeellll _m_e_s_s_a_g_e
X
X          When a bell character is sent to a background window, _s_c_r_e_e_n
X          displays a notification in the message line (see below).
X          The notification message can be re-defined by means of the
X          "bell" command; each occurrence of `%' in _m_e_s_s_a_g_e is
X          replaced by the number of the window to which a bell has
X          been sent.  The default message is
X
X               Bell in window %
X
X          An empty message can be supplied to the "bell" command to
X          suppress output of a message line (bell "").
X
X
X
X
X
X
X     Page 3                                          (printed 9/22/88)
X
X
X
X
X
X
X     SCREEN(1)         OS9/68000 V2.1 (2 March 1987)         SCREEN(1)
X
X
X
X          ssccrreeeenn [[_n]] [[_c_m_d_s _a_r_g_s]]
X
X          Establish a window.  If an optional number _n in the range
X          0..9 is given, the window number _n is assigned to the newly
X          created window (or, if this number is already in use, the
X          next higher number).  Note that _n has a value of zero for
X          the standard shell window created after ".screenrc" has been
X          read.  If a command is specified after "screen", this
X          command (with the given arguments) is started in the window;
X          if no command is given, a shell is created in the window.
X          Thus, if your ".screenrc" contains the lines
X
X               # example for .screenrc:
X               screen 1
X               screen 2 telnet foobar
X
X          _s_c_r_e_e_n creates a shell window (window #1), a window with a
X          TELNET connection to the machine foobar (window #2), and,
X          finally, a second shell window (the default window) which
X          gets a window number of zero.  When the initialization is
X          completed, _s_c_r_e_e_n always switches to the default window, so
X          window #0 is displayed when the above ".screenrc" is used.
X
X          cchhddiirr [[_d_i_r_e_c_t_o_r_y]]
X
X          Change the _c_u_r_r_e_n_t _d_i_r_e_c_t_o_r_y of _s_c_r_e_e_n to the specified
X          directory or, if called without an argument, to the home
X          directory (the value of the environment symbol $HOME).  All
X          windows that are created by means of the "screen" command
X          from within ".screenrc" or by means of "C-a c'' are running
X          in the _c_u_r_r_e_n_t _d_i_r_e_c_t_o_r_y; the _c_u_r_r_e_n_t _d_i_r_e_c_t_o_r_y is initially
X          the directory from which the shell command _s_c_r_e_e_n has been
X          invoked.  Hardcopy files are always written to the directory
X          in which the current window has been created (that is, _n_o_t
X          in the current directory of the shell running in the
X          window).
X
X          bbiinndd _k_e_y [[_f_u_n_c_t_i_o_n || _c_m_d _a_r_g_s]]
X
X          Bind a function to a key.  By default, each function
X          provided by _s_c_r_e_e_n is bound to one or more keys as indicated
X          by the above table, e.g. the function to create a new window
X          is bound to "C-c" and "c".  The "bind" command can be used
X          to redefine the key bindings and to define new bindings.
X          The _k_e_y argument is either a single character, a sequence of
X          the form "^x" meaning "C-x", or an octal number specifying
X          the ASCII code of the character.  If no further argument is
X          given, any previously established binding for this key is
X          removed.  The _f_u_n_c_t_i_o_n argument can be one of the following
X          keywords:
X
X               shell        Create new window with a shell
X               kill         Kill the current window
X               quit         Kill all windows and terminate
X               other        Switch to previously displayed window
X               next         Switch to the next window
X               prev         Switch to the previous window
X               redisplay    Redisplay current window
X
X
X
X     Page 4                                          (printed 9/22/88)
X
X
X
X
X
X
X     SCREEN(1)         OS9/68000 V2.1 (2 March 1987)         SCREEN(1)
X
X
X
X               hardcopy     Make hardcopy of current window
X               termcap      Write termcap entry to $HOME/.screen/.termcap
X               suspend      Suspend _s_c_r_e_e_n
X               windows      Display list of window
X               info         Print useful information in the message line
X               xon          Send Control-q
X               xoff         Send Control-s
X               version      Display the version
X               select0      Switch to window #0
X                 ...
X               select9      Switch to window #9
X
X          In addition, a key can be bound such that a window is
X          created running a different command than the shell when that
X          key is pressed.  In this case, the command optionally
X          followed by arguments must be given instead of one of the
X          above-listed keywords.  For example, the commands
X
X               bind ' ' windows
X               bind ^f telnet foobar
X               bind 033 su
X
X          would bind the space key to the function that displays a
X          list of windows (that is, the function usually invoked by
X          "C-a C-w" or "C-a w" would also be available as "C-a
X          space"), bind "C-f" to the function "create a window with a
X          TELNET connection to foobar", and bind "escape" to the
X          function that creates a window with a super-user shell.
X
X     VIRTUAL TERMINAL
X          _S_c_r_e_e_n prints error messages and other diagnostics in a
X          _m_e_s_s_a_g_e _l_i_n_e above the bottom of the screen.  The message
X          line is removed when a key is pressed or, automatically,
X          after a couple of seconds.  The message line facility can be
X          used by an application running in the current window by
X          means of the ANSI _P_r_i_v_a_c_y _m_e_s_s_a_g_e control sequence (for
X          instance, from within the shell, something like
X
X               echo '^[^Hello world^[\'   (where ^[ is an _e_s_c_a_p_e)
X
X          can be used to display a message line.
X
X          When the `NF' capability is found in the termcap entry of
X          the terminal on which _s_c_r_e_e_n has been started, flow control
X          is turned off for the terminal.  This enables the user to
X          send XON and XOFF characters to the program running in a
X          window (this is required by the _e_m_a_c_s editor, for instance).
X          The command line options --nn and --ff can be used to turn flow
X          control off or on, respectively, independently of the `NF'
X          capability.
X
X          _S_c_r_e_e_n never writes in the last position of the screen,
X          unless the boolean capability `LP' is found in the termcap
X          entry of the terminal.  Usually, _s_c_r_e_e_n cannot predict
X          whether or not a particular terminal scrolls when a
X          character is written in the last column of the last line;
X          `LP' indicates that it is safe to write in this position.
X          Note that the `LP' capability is independent of `am'
X
X
X
X     Page 5                                          (printed 9/22/88)
X
X
X
X
X
X
X     SCREEN(1)         OS9/68000 V2.1 (2 March 1987)         SCREEN(1)
X
X
X
X          (automatic margins); for certain terminals, such as the
X          VT100, it is reasonable to set `am' as well as `LP' in the
X          corresponding termcap entry (the VT100 does not move the
X          cursor when a character is written in the last column of
X          each line).
X
X          _S_c_r_e_e_n puts into the environment of each process started in
X          a newly created window the symbols "WINDOW=_n" (where _n is
X          the number of the respective window), "TERM=screen", and a
X          TERMCAP variable reflecting the capabilities of the virtual
X          terminal emulated by _s_c_r_e_e_n.  The actual set of capabilities
X          supported by the virtual terminal depends on the
X          capabilities supported by the physical terminal.  If, for
X          instance, the physical terminal does not support standout
X          mode, _s_c_r_e_e_n does not put the `so' and `se' capabilities
X          into the window's TERMCAP variable, accordingly. However, a
X          minimum number of capabilities must be supported by a
X          terminal in order to run _s_c_r_e_e_n, namely scrolling, clear
X          screen, and direct cursor addressing (in addition, _s_c_r_e_e_n
X          does not run on hardcopy terminals or on terminals that
X          overstrike).
X
X          Some capabilities are only put into the TERMCAP variable of
X          the virtual terminal if they can be efficiently implemented
X          by the physical terminal.  For instance, `dl' (delete line)
X          is only put into the TERMCAP variable if the terminal
X          supports either delete line itself or scrolling regions.  If
X          _s_c_r_e_e_n is called with the --aa option, _a_l_l capabilities are
X          put into the environment, even if _s_c_r_e_e_n must redraw parts
X          of the display in order to implement a function.
X
X          The following is a list of control sequences recognized by
X          _s_c_r_e_e_n.  "(V)" and "(A)" indicate VT100-specific and ANSI-
X          specific functions, respectively.
X
X          EESSCC EE                    Next Line
X
X          EESSCC DD                    Index
X
X          EESSCC MM                    Reverse Index
X
X          EESSCC HH                    Horizontal Tab Set
X
X          EESSCC 77               (V)  Save Cursor and attributes
X
X          EESSCC 88               (V)  Restore Cursor and Attributes
X
X          EESSCC cc                    Reset to Initial State
X
X          EESSCC ==               (V)  Application Keypad Mode
X
X          EESSCC >>               (V)  Numeric Keypad Mode
X
X          EESSCC ## 88             (V)  Fill Screen with E's
X
X          EESSCC \\               (A)  String Terminator
X
X          EESSCC ^^               (A)  Privacy Message (Message Line)
X
X
X
X     Page 6                                          (printed 9/22/88)
X
X
X
X
X
X
X     SCREEN(1)         OS9/68000 V2.1 (2 March 1987)         SCREEN(1)
X
X
X
X          EESSCC PP               (A)  Device Control String (not used)
X
X          EESSCC __               (A)  Application Program Command (not used)
X
X          EESSCC ]]               (A)  Operating System Command (not used)
X
X          EESSCC [[ PPnn ;; PPnn HH
X                                   Direct Cursor Addressing
X
X          EESSCC [[ PPnn ;; PPnn ff
X                                   Direct Cursor Addressing
X
X          EESSCC [[ PPnn JJ               Erase in Display
X
X              Pn = None or 00       From Cursor to End of Screen
X
X              11                    From Beginning of Screen to Cursor
X
X              22                    Entire Screen
X
X          EESSCC [[ PPnn KK               Erase in Line
X
X              Pn = None or 00       From Cursor to End of Line
X
X              11                    From Beginning of Line to Cursor
X
X              22                    Entire Line
X
X          EESSCC [[ PPnn AA               Cursor Up
X
X          EESSCC [[ PPnn BB               Cursor Down
X
X          EESSCC [[ PPnn CC               Cursor Right
X
X          EESSCC [[ PPnn DD               Cursor Left
X
X          EESSCC [[ PPss ;;......;; PPss mm
X                                   Select Graphic Rendition
X
X              Ps = None or 00       Default Rendition
X
X              11                    Bold
X
X              22               (A)  Faint
X
X              33               (A)  _S_t_a_n_d_o_u_t Mode (ANSI: Italicised)
X
X              44                    Underlined
X
X              55                    Blinking
X
X              77                    Negative Image
X
X              2222              (A)  Normal Intensity
X
X              2233              (A)  _S_t_a_n_d_o_u_t Mode off (ANSI: Italicised off)
X
X              2244              (A)  Not Underlined
X
X
X
X     Page 7                                          (printed 9/22/88)
X
X
X
X
X
X
X     SCREEN(1)         OS9/68000 V2.1 (2 March 1987)         SCREEN(1)
X
X
X
X              2255              (A)  Not Blinking
X
X              2277              (A)  Positive Image
X
X          EESSCC [[ PPnn gg               Tab Clear
X
X              Pn = None or 00       Clear Tab at Current Position
X
X              33                    Clear All Tabs
X
X          EESSCC [[ PPnn ;; PPnn rr
X                              (V)  Set Scrolling Region
X
X          EESSCC [[ PPnn II          (A)  Horizontal Tab
X
X          EESSCC [[ PPnn ZZ          (A)  Backward Tab
X
X          EESSCC [[ PPnn LL          (A)  Insert Line
X
X          EESSCC [[ PPnn MM          (A)  Delete Line
X
X          EESSCC [[ PPnn @@          (A)  Insert Character
X
X          EESSCC [[ PPnn PP          (A)  Delete Character
X
X          EESSCC [[ PPss  ;;......;; PPss hh
X                                   Set Mode
X
X          EESSCC [[ PPss  ;;......;; PPss ll
X                                   Reset Mode
X
X              Ps = 44          (A)  Insert Mode
X
X              ??55              (V)  Visible Bell (_O_n followed by _O_f_f)
X
X              ??66              (V)  _O_r_i_g_i_n Mode
X
X              ??77              (V)  _W_r_a_p Mode
X
X     FILES
X          $(HOME)/.screenrc   _s_c_r_e_e_n initialization commands
X          $(HOME)/.screen     Directory created by _s_c_r_e_e_n
X          $(HOME)/.screen/_t_t_y Socket created by _s_c_r_e_e_n
X          hardcopy.[0-9]      Screen images created by the hardcopy function
X          /etc/termcap        Terminal capability data base
X          /etc/utmp           Login records
X          /etc/ttys           Terminal initialization data
X
X     SEE ALSO
X          termcap(5), utmp(5)
X
X     AUTHOR
X          Oliver Laumann
X
X     BUGS
X          Standout mode is not cleared before newline or cursor
X          addressing.
X
X
X
X
X     Page 8                                          (printed 9/22/88)
X
X
X
X
X
X
X     SCREEN(1)         OS9/68000 V2.1 (2 March 1987)         SCREEN(1)
X
X
X
X          If `LP' is not set but `am' is set, the last character in
X          the last line is never written, and it is not correctly re-
X          displayed when the screen is scrolled up or when a character
X          is deleted in the last line.
X
X          The VT100 "wrap around with cursor addressing" bug is not
X          compensated when _s_c_r_e_e_n is running on a VT100.
X
X          `AL,' `DL', and similar parameterized capabilities are not
X          used if present.
X
X          `dm' (delete mode), `xn', and `xs' are not handled correctly
X          (they are ignored).
X
X          Different character sets are not supported.
X
X          `ms' is not advertised in the termcap entry (in order to
X          compensate a bug in _c_u_r_s_e_s(3X)).
X
X          Scrolling regions are only emulated if the physical terminal
X          supports scrolling regions.
X
X          _S_c_r_e_e_n does not make use of hardware tabs.
X
X          _S_c_r_e_e_n must be installed as set-uid with owner root in order
X          to be able to correctly change the owner of the tty device
X          file for each window.  Special permission may also be
X          required to write the file "/etc/utmp".
X
X          Entries in "/etc/utmp" are not removed when _s_c_r_e_e_n is killed
X          with SIGKILL.
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X     Page 9                                          (printed 9/22/88)
X
X
X
END_OF_FILE
echo shar: 962 control characters may be missing from \"'screen.man'\"
if test 24002 -ne `wc -c <'screen.man'`; then
    echo shar: \"'screen.man'\" unpacked with wrong size!
fi
# end of 'screen.man'
fi
echo shar: End of archive 1 \(of 3\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 3 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
  |  Wolfgang Ocker          |  ocker@lan.informatik.tu-muenchen.dbp.de  |
  |  Lochhauserstr. 35a      |      pyramid!tmpmbx!recco!weo (home)      |
  |  D-8039 Puchheim         |     Technische Universitaet Muenchen      |
  |  Voice: +49 89 80 77 02  |          Huh, What? Where am I?           |