README for Rterm.exe
====================

Rterm.exe can be used in three distinct modes:

1) Interactively in an MSDOS / Commands window.
2) In batch mode by redirecting its input from a file or pipe.
3) As a no-echo process for ESS mode in NTEmacs with flag --ess.

Its purpose is to provide something similar to the main Unix interface
for R, including a batch capability.  The command-line arguments are
the same as those for RGui.exe and are documented in `An Introduction
to R' in the section `Invoking R under Windows' (--mdi and --sdi are
accepted but do nothing).  Batch use is covered in the rw-FAQ Q2.10.

In interactive use the interpreter can be interrupted by Ctrl-C or
Ctrl-Break.  Input is interpreted as-is except for the keys
interpreted by getline (see below) and that special characters
can be entered by Alt+numerical-key-pad sequences of up to 3 characters,
so Alt+123 and Alt+72 give {H, for example.

Command-line editing and history in interactive use
---------------------------------------------------

Input editing handles a single line and so scrolls long lines left and
right on the same line.  Until the user presses the RETURN key they
can use Emacs-style line editing commands and can traverse the history
of lines previously typed.

Entering printable keys generally inserts new text into the buffer (unless
in overwrite mode, see below).  Other special keys can be used to modify
the text in the buffer.  In the description of the keys below, ^n means
Control-n, or holding the CONTROL key down while pressing "n".  Errors
will ring the terminal bell.  A 'word' is delimited by spaces.

left/right, ^F/^B   : Move cursor forward/backward one character.
up/down,    ^P/^N   : Move to previous/next item on history list.
Home, ^A	: Move cursor to beginning of the line.
End,  ^E 	: Move cursor to end of the line.
ESC-F	: Move cursor forward one word.
ESC-B   : Move cursor backward one word.
^D, DEL	: Delete the character under the cursor.
^H	: Delete the character to the left of the cursor.
^K	: Kill from the cursor to the end of line.
^L	: Redraw current line.
^O	: Toggle overwrite/insert mode. Initially in insert mode. Text
	  added in overwrite mode (including yanks) overwrite
	  existing text, while insert mode does not overwrite.
^R/^S   : Perform incremental reverse/forward search for string on
	  the history list.  Typing normal characters adds to the current
	  search string and searches for a match. Typing ^R/^S marks
	  the start of a new search, and moves on to the next match.
	  Typing ^H or DEL deletes the last character from the search 
	  string, and searches from the starting location of the last search.  
	  Therefore, repeated DEL's appear to unwind to the match nearest 
	  the point at which the last ^R or ^S was typed.  If DEL is 
	  repeated until the search string is empty the search location 
	  begins from the start of the history list.  Typing ESC or 
	  any other editing character accepts the current match and 
	  loads it into the buffer, terminating the search.
^T	: Transpose the characters under and to the left of the cursor.
^U      : Deletes the entire line
^W      : Deletes the previous word
^Y	: Yank previously killed text back at current location.  Note that
	  this will overwrite or insert, depending on the current mode.
TAB	: Within quotes, completes the current word as a file name,
	  otherwise as an R object name.  Completion is does as far as 
	  can be done unambiguously.  A second press shows alternative 
	  completions.  However, if environment variable R_COMPLETION is
	  set to FALSE, this advances to the next tab stop (set at every 
	  8th column). 
NL, CR  : returns current buffer to the program.

