MPE/iX Shell and Utilities Reference Manual, Vol 2

shedit(3) MPE/iX Shell and Utilities shedit(3)
NAME
shedit — interactive command and history editing in the shell
SYNOPSIS
set –o editmode
EDITOR=editprog
VISUAL=editprog
DESCRIPTION
POSIX uses a number of keys for such things as erase and kill processing. By default, the shell
leaves command line editing to POSIX, using these familiar editing keys. However, these func-
tions are not particularly powerful or friendly. As an alternative, the shell has built-in facili-
ties for interactive command editing and file name generation that not only aid in composing
new commands but also provide for convenient modification and re-execution of previous
commands. This capability is distinct from that provided by the fc(1) command, which
passes previous command lines to a separate program for editing. The built-in facilities mim-
ic the emacs, gmacs,orVi screen editors, and are enabled the following commands (see
set(1) and vi(1) for details.)
set -o emacs
set -o gmacs
set -o vi
These facilities are also enabled (with the corresponding option set) by assigning a value end-
ing in emacs, gmacs,orvi to the variable
EDITOR
or
VISUAL
(see sh(1)).
Unlike full-screen editors, shell editing uses a one-line window, extending from the end of the
prompt to the second-last column. Multi-line history entries are displayed with newlines rep-
resented as ˆJ. The number of columns on the output device is obtained from the
COLUMNS
variable if defined; otherwise, it is assumed to be 80. A command line that extends into the
rightmost column can be scrolled horizontally. If you try to move the cursor beyond the edge
of the window, the line is scrolled to approximately centre the cursor in the window. The sec-
ond last column displays a character marking a scrollable line: < indicates extra data off the
left; > indicates extra data off the right; and * indicates extra data off both sides.
EMACS/GMACS EDITING MODE
When this editing mode has been enabled, by any of the means noted earlier, ordinary print-
able characters from the keyboard are entered in the command line (and echoed). Various
control characters introduce command sequences for such things as moving the cursor, scrol-
ling through the command history, and modifying the current command. The only difference
between emacs and gmacs mode is in the handling of CTRL-T (see the description of CTRL-in
the Text Change subsection).
3-38 Miscellaneous Information