-* Single Shell:: How to run one shell command and return.
-* Interactive Shell:: Permanent shell taking input via XEmacs.
-* Shell Mode:: Special XEmacs commands used with permanent shell.
-* Terminal emulator:: An XEmacs window as a terminal emulator.
-* Term Mode:: Special XEmacs commands used in Term mode.
-* Paging in Term:: Paging in the terminal emulator.
-
-\1f
-File: xemacs.info, Node: Single Shell, Next: Interactive Shell, Prev: Shell, Up: Shell
-
-Single Shell Commands
----------------------
-
- `M-!' (`shell-command') reads a line of text using the minibuffer
-and creates an inferior shell to execute the line as a command.
-Standard input from the command comes from the null device. If the
-shell command produces any output, the output goes to an XEmacs buffer
-named `*Shell Command Output*', which is displayed in another window
-but not selected. A numeric argument, as in `M-1 M-!', directs this
-command to insert any output into the current buffer. In that case,
-point is left before the output and the mark is set after the output.
-
- `M-|' (`shell-command-on-region') is like `M-!' but passes the
-contents of the region as input to the shell command, instead of no
-input. If a numeric argument is used to direct output to the current
-buffer, then the old region is deleted first and the output replaces it
-as the contents of the region.
-
- Both `M-!' and `M-|' use `shell-file-name' to specify the shell to
-use. This variable is initialized based on your `SHELL' environment
-variable when you start XEmacs. If the file name does not specify a
-directory, the directories in the list `exec-path' are searched; this
-list is initialized based on the `PATH' environment variable when you
-start XEmacs. You can override either or both of these default
-initializations in your `.emacs' file.
-
- When you use `M-!' and `M-|', XEmacs has to wait until the shell
-command completes. You can quit with `C-g'; that terminates the shell
-command.
-
-\1f
-File: xemacs.info, Node: Interactive Shell, Next: Shell Mode, Prev: Single Shell, Up: Shell
-
-Interactive Inferior Shell
---------------------------
-
- To run a subshell interactively with its typescript in an XEmacs
-buffer, use `M-x shell'. This creates (or reuses) a buffer named
-`*shell*' and runs a subshell with input coming from and output going
-to that buffer. That is to say, any "terminal output" from the subshell
-will go into the buffer, advancing point, and any "terminal input" for
-the subshell comes from text in the buffer. To give input to the
-subshell, go to the end of the buffer and type the input, terminated by
-<RET>.
-
- XEmacs does not wait for the subshell to do anything. You can switch
-windows or buffers and edit them while the shell is waiting, or while
-it is running a command. Output from the subshell waits until XEmacs
-has time to process it; this happens whenever XEmacs is waiting for
-keyboard input or for time to elapse.
-
- To get multiple subshells, change the name of buffer `*shell*' to
-something different by using `M-x rename-buffer'. The next use of `M-x
-shell' creates a new buffer `*shell*' with its own subshell. By
-renaming this buffer as well you can create a third one, and so on.
-All the subshells run independently and in parallel.
-
- The file name used to load the subshell is the value of the variable
-`explicit-shell-file-name', if that is non-`nil'. Otherwise, the
-environment variable `ESHELL' is used, or the environment variable
-`SHELL' if there is no `ESHELL'. If the file name specified is
-relative, the directories in the list `exec-path' are searched (*note
-Single Shell Commands: Single Shell.).
-
- As soon as the subshell is started, it is sent as input the contents
-of the file `~/.emacs_SHELLNAME', if that file exists, where SHELLNAME
-is the name of the file that the shell was loaded from. For example,
-if you use `csh', the file sent to it is `~/.emacs_csh'.
-
- `cd', `pushd', and `popd' commands given to the inferior shell are
-watched by XEmacs so it can keep the `*shell*' buffer's default
-directory the same as the shell's working directory. These commands
-are recognized syntactically by examining lines of input that are sent.
-If you use aliases for these commands, you can tell XEmacs to
-recognize them also. For example, if the value of the variable
-`shell-pushd-regexp' matches the beginning of a shell command line,
-that line is regarded as a `pushd' command. Change this variable when
-you add aliases for `pushd'. Likewise, `shell-popd-regexp' and
-`shell-cd-regexp' are used to recognize commands with the meaning of
-`popd' and `cd'.
-
- `M-x shell-resync-dirs' queries the shell and resynchronizes XEmacs'
-idea of what the current directory stack is. `M-x
-shell-dirtrack-toggle' turns directory tracking on and off.
-
- XEmacs keeps a history of the most recent commands you have typed in
-the `*shell*' buffer. If you are at the beginning of a shell command
-line and type <M-p>, the previous shell input is inserted into the
-buffer before point. Immediately typing <M-p> again deletes that input
-and inserts the one before it. By repeating <M-p> you can move
-backward through your commands until you find one you want to repeat.
-You may then edit the command before typing <RET> if you wish. <M-n>
-moves forward through the command history, in case you moved backward
-past the one you wanted while using <M-p>. If you type the first few
-characters of a previous command and then type <M-p>, the most recent
-shell input starting with those characters is inserted. This can be
-very convenient when you are repeating a sequence of shell commands.
-The variable `input-ring-size' controls how many commands are saved in
-your input history. The default is 30.