-*-Text-*-

File: REATTA,  Node: Top,  Up: (DIR),  Next: Function

The REATTACH Program:

REATTACH is a program for connecting job-trees to terminals.
It can be used to "move" a user from one terminal to another,
or to exchange terminals with another user.

* Menu:
* Function::  Exactly what REATTACH's function is
* Args::      Argument syntax for REATTACH
* Switches::  Switches for REATTACH
* Recovery::  Recovering after a tree has been moved
		to a different type of terminal

These are the common ways to use REATTACH:

To reconnect to your own detached tree, killing your current tree.
This is the thing to do if you forgot to type a space when DDT offered
to do the attaching for you.  (Note: this case, of no arguments, is
handled specially and its behavior cannot be deduced from the general
rules).

	:REATTACH

To bring your tree, named FOOBAR, which may be at some other terminal
or may be detached, to the terminal you are now typing on,

	:REATTACH FOOBAR

To exchange terminals with FOOBAR, so that his tree moves to the
terminal you are now typing on, and your tree moves from that
terminal to FOOBAR's old terminal, type

	:REATTA FOOBAR/X

To move yourself to another terminal (TTY 69), if you are at your
old one, do

	:REATTACH T69

In this case, if T69 is in use, you must specify /F.

File: REATTA,  Node: Function,  Up: Top,  Previous: Top,  Next: Args

REATTA's capabilities:

REATTA's basic function is to attach a specified job-tree to a
specified terminal.  While your own tree and your own terminal
are the defaults, any tree and any terminal can be specified.

In some cases, the basic function may require or suggest
auxiliary functions.  For example, if there is a tree attached
to the specified terminal, various things can be done to it.
It could simply be detached;  it could be killed;  it could be
put in place of the specified tree, so that the two trees
exchange terminals.

File: REATTA,  Node: Args,  Up: Top,  Previous: Function,  Next: Switches

REATTA's arguments:

When REATTACH runs, it has to know the following things:
1) which job to attach, determined by uname and jname, and
2) which TTY to attach it to, determined by the TTY number.

The arguments to REATTACH allow you to specify those things,
as well as set switches.
Arguments are normally separated by spaces or commas.  "*"
does not need to be separated; it is a "single character object".

An argument that consists of digits alone, with optionally a
"T" in front or a ":" afterward, is a TTY number, and says that
the specified TTY is the one to attach to.  If no TTY number is
specified, the TTY REATTACH is running under will be used (this
requires detaching the tree that REATTACH is in;  REATTACH
will do that automatically).  It does not work to specify a TV
TTY explicitly if it is free, since the pdp-11 will not know to
connect the TTY to any keyboard.

Any other argument is one of the names of the job to be attached.
The first name given specifies the uname; the second, the jname.
If the uname is not specified, or is "*", then REATTACH's uname
(ie, your own) will be used.  If the jname is not specified,
REATTACH will try both "HACTRO" and "HACTRN", in that order,
and use whichever exists.  In order to be attached, a job must
be top-level, but it need not be disowned - REATTACH will make
it disowned by detaching it if necessary.  To specify a name
that looks like a TTY number, quoting one of the characters in it
with ^Q will make it be taken as a name.  The characters " ", ",",
"/", and "*" can be put in names with ^Q.

File: REATTA,  Node: Switches,  Up: Top,  Previous: Args,  Next: Recovery

REATTA's switches:

Switches consist of single letters preceded by a slash ("/").
They separate arguments just like spaces.  Right now, the
meaningful switches are "/F", "/K", and "/X".

"/F" tells REATTACH to go ahead even if the specified TTY is in
use.  REATTACH will detach the tree that is using it to free it
up (if the TTY is in use as a device, there is no way to free it
up, so REATTACH will fail even with "/F").  "/F" is not necessary
when your own TTY is being attached to. 

"/K" tells REATTACH that when it detaches a tree, whether because
of "/F" or because you are reattaching to your own TTY, the tree
that is detached should be gunned down.  /K is automatic when you
are attaching another tree to your own TTY and you are not logged
in.  Please be careful not to use /K except on yourself. 

"/X" tells REATTACH that, if a tree has to be detached from the
specified TTY, that tree should not be left disowned or killed,
but should be attached to the TTY which the specified job was
taken away from.  Thus, the two trees exchange TTYs.

File: REATTA, Node: Recovery, Up: Top, Previous: Switches

Recovering from a REATTA.

Because REATTA moves jobs to a different terminal, which may not
be the same type as the previous one, jobs which pay attention
to such things as the terminal size will need to be told to take
note of the new terminal's differences.

DDT can be told to notice a change of TTY with the :NEWTTY command.
REATTA valrets a :NEWTTY automatically if it moves its own tree,
but it has no way of informing any other tree of the move.

TECO can be told about a change in terminal by restarting it (G).
This never causes any harm to the information in the TECO.

SUPDUP is hopeless to inform of a change in the terminal, since
it has passed a complete description of its old one to the
remote machine and has no way of correcting it.
You should simply kill the SUPDUP, thus detaching the tree at
the other end of it, and start a new SUPDUP to pick that tree up
again.  TECOs in that tree will need to be G'd, etc.
