-- Chat.doc
-- L. Stewart June 13, 1983 1:45 pm

Chat for Cedar 4.2

Get chat loaded by typing "Run Chat" to the UserExec.

To create an instance of a Chat viewer, type "Chat" to the UserExec.  Multiple chat viewers can coexist, with connections to the same or different remote hosts.

Running Chat from the command line

Chat has a primitive command line interpreter.
	A command line of just "Chat" will create an iconic Chat viewer with no open connection.  It must be used interactively (see below).
	The most general command line is:
	
		Chat remoteHostName [-loginSwitchChar] [>logFile] [<initialKeystrokeFile | -k "keyStroke String"] [-d] [-s]
	
	Items in brackets are optional, spaces are important.
	
	remoteHostName would be something like "indigo", "dls+100016", "3#177#" or other Pup network name.
	
	loginSwitchChar is one of the characters 'l, 'c, or 'i.
		'l => login to remote host
		'c => connect to remote host
		'i => leave viewer iconic, initialize remote host name, but don't connect (see below)
	
	logFile is the name of the file you wish to use for a typescript.  Only characters which arrive from the remote host are recorded, not your own keystrokes.  If the ">logFile" is omitted, a logFile name in the sequence "Chat0.log" "Chat1.log" will be chosen for you.
	
	initialKeystrokeFile is the name of a file whose contents will be sent to the remote host as soon as the connection is established and the login sequence (if requested) has been completed.  After the end of the initialKeystrokeFile is reached, Chat will enter its usual interactive mode.  Instead of a keystroke file, you may place the initial sequence of characters to send right on the command line, using the -k switch.
	
	If you include the -d switch together with a keystroke option, if the connection is closed remotely, the chat viewer will be destroyed.
	
	If you include the -s switch, the call to Chat from the executive will not return until the chat viewer is destroyed (either by hand or by the -d option).

Running Chat interactively

	A chat viewer is an ordinary editable typescript with a number of added facilities.  chief among these is that when a connection to a remote host is open, characters entered at the end of the typescript are sent to the remote host and characters from the remote host appear at the end of the typescript.
	
	A chat viewer has the usual Viewers menu items plus several special menu items.
	
	Disconnect - closes connection if one is open.
	Login - opens connection using specified host name (see below) and transmits "Login UserName Password" to the remote host.
	Connect - opens connection
	BreakKey - transmits an Ascii NUL ('\000) if there is an open connection. (The DLS interprets NUL as a request to send a line break.)
	FlushLog - Forces all characters which have arrived from the remote host to be written to disk.

The Login and Connect buttons are a bit more complex.  If you previously had an open connection which is now closed, pushing Login or Connect with the Yellow or Blue mouse buttons will re-open a connection to the old remote host, rather than using a newly specified host name.

	Specifying a host name:

	If the primary selection is longer than one character, then the selected text is interpreted by Chat as the name of the remote host.  If the primary selection is one character long or is a point selection, then Chat scans backwards interprets the token to the left of the caret as the name of the remote host.
	
	Keyboard commands:
	
	Chat uses a special TIP table that permits some commands to be entered from the keyboard during interactive use.
	
	LF - same as Connect.  Type the name of the remote host and hit LF to connect.
	Shift-LF - same as Login.  Type the name of the remote host and hit Shift-LF to login.
	Control-Space - same as BreakKey.  Transmit a NUL is there is an open connection.
	Control-DEL - same as Disconnect.
	
	The only exception is that if Control-DEL is typed while characters are being read from a keystroke file, the keystroke file will be immediately closed and control will become interactive, but the connection will not be closed.
	
	Differences from Cedar 3.5 Chat:
	
	Closing a chat viewer does not close an open connection.

	Typescript files now work.  The Typescript viewers implementation will eventually truncate the visible, scrollable contents of the viewer, but the log file is never truncated.
	
	After you select a host name and bug Login or Open, the input focus is moved to the end of the viewer.
	
	If you type a Chat command line which opens a Chat viewer, the input focus is moved to that viewer.