editread(5) DG/UX 4.30 editread(5)
NAME
editread - command line editor
DESCRIPTION
Editread is an optional interface that you can use in sh(1),
csh(1), and crash(1M) for editing command lines. Editread
also offers a history facility that saves command lines for
later recall, editing, and execution. The editread history
facility is separate from the C shell history facility;
their functions are similar but their implementations and
use are different.
Editread is disabled by default. To enable the facility,
you need a file named .editreadrc in your home directory or
current directory. You can create an empty file named
.editreadrc, which causes the default editread values to be
recognized. Alternatively, you can copy
/usr/lib/editreadrc.proto to $HOME/.editreadrc. After you
have a .editreadrc file, it will be in effect for all child
processes of a parent process (but not for the parent
itself). Editread will be active the next time you log in.
To find out the current values for the editread functions,
use your reconfig key (<Ctrl-R> by default). The following
screen shows the default values.
_______________________________________________________________________
| E D I T R E A D C O N F I G U R A T I O N D I S P L A Y |
| |
| CURSOR CONTROL LINE EDITING HISTORY |
| |
| backward = ^b insert = ^n hist_display = 23 |
| forward = ^f insert_space = OFF hist_save = 100 |
| goto_end = ^e erase = DEL hist_recall = ESC |
| goto_end_ov = word_erase = ^t hist_scan = ^p |
| home = ^a kill = ^u hist_up = UP |
| left = LEFT delete_end = ^k hist_down = DOWN|
| right = RIGHT |
| |
| PROCESS CONTROL CONFIGURING EDITREAD MISCELLANEOUS |
| |
| eof = ^d enable = ON prompt = OFF |
| intr = ^c reconfig = ^r refresh = |
| quit = ^\ verbatim = ^v |
| susp = ^z term = 605x|
|______________________________________________________________________|
Note: The caret (^) in this configuration display
represents the <Ctrl> key.
Functions and Default Values
Each function and default value is described as follows:
Licensed material--property of copyright holder(s) Page 1
editread(5) DG/UX 4.30 editread(5)
______________________________________________________________________
| Keyword Description Default Value |
|_____________________________________________________________________|
| Editread Configuration |
|_____________________________________________________________________|
| enable Turns editread off or on. ON |
| reconfig Displays the current <Ctrl-R> |
| editread values and |
| concludes a redefinition of |
| a single function or |
| multiple functions. |
|_____________________________________________________________________|
| Cursor Control |
|_____________________________________________________________________|
| right Moves the cursor one position Rightarrow key |
| to the right. |
| left Moves the cursor one position Leftarrow key |
| to the left. |
| gotoend Moves the cursor to the end of <Ctrl-E> |
| the line. |
| gotoendov Retrieves the previous command unassigned |
| line and appends it to the |
| current command line at the |
| cursor position. |
| home Returns the cursor to the <Ctrl-A> |
| beginning of the line. |
| forward Moves the cursor to the <Ctrl-F> |
| beginning of the next word. |
| backward Moves the cursor backward to <Ctrl-B> |
| the space after the previous |
| word. |
|_____________________________________________________________________|
| Line Editing |
|_____________________________________________________________________|
| erase Erases a character one <Del> |
| position to the left of the |
| cursor. |
| worderase Deletes from the current <Ctrl-T> |
| cursor position through the |
| end of the word. |
| deleteend Deletes from the cursor <Ctrl-K> |
| position to the end of the |
| line. |
| kill Erases the entire line. <Ctrl-U> |
| insert Enables and disables (toggles) <Ctrl-N> |
| insert mode. |
| insertspace When insert mode is in effect, OFF |
| a leading space always appears |
| to the left of the cursor. |
|_____________________________________________________________________|
Licensed material--property of copyright holder(s) Page 2
editread(5) DG/UX 4.30 editread(5)
|_____________________________________________________________________|
| History |
|_____________________________________________________________________|
| histrecall Displays the history list. <Esc> |
| histscan Searches the history list for <Ctrl-P> |
| a given regular expression and |
| shows matches. |
| histup Recalls the previous command Uparrow key |
| in the history list. |
| histdown Recalls the next command in Downarrow key |
| the history list. |
| histsave Sets the maximum number of 100 |
| commands to be saved in |
| history. |
| histdisplay Sets the number of commands to 23 |
| be displayed at one time when |
| you press the reconfig key. |
| writehist Is not a function you can writehist file<reconfig>
| configure but a command you |
| can use to write history |
| commands to a file. |
| readhist Is not a function you can readhist file<reconfig>|
| configure but a command you |
| can use to read a file |
| containing a history list to |
| the current history list. |
|_____________________________________________________________________|
(Continued)
Licensed material--property of copyright holder(s) Page 3
editread(5) DG/UX 4.30 editread(5)
_____________________________________________________
| Keyword Description Default |
|____________________________________________________|
| Process Control |
|____________________________________________________|
| eof Sets the end-of-file <Ctrl-D> |
| character. |
| intr Sets the interrupt key. <Del> |
| quit Sets the quit key. <Ctrl-\> |
| susp Sets the suspend key. <Ctrl-Z> |
|____________________________________________________|
| Miscellaneous |
|____________________________________________________|
| prompt Prints an editread prompt ($) OFF |
| preceded by the current |
| history number. |
| refresh Refreshes the current line. unassigned |
| verbatim Nullifies (escapes) the <Ctrl-V> |
| meaning of a key to editread. |
| term Identifies your terminal type. 605x |
|____________________________________________________|
Assigning Values to Functions
You can reassign values to editread functions in a
.editreadrc file (in either the home or current directory),
in the EDITREAD environment variable, or interactively. The
following order of precedence is followed when enabling
editread.
- editread value set interactively,
- EDITREAD environment variable,
- .editreadrc in the current directory,
- .editreadrc in the home directory.
Pressing the reconfig key (default is <Ctrl-R>) gives a
display of the current editread values, which are comprised
of the defaults, those set interactively, and those set in
an .editreadrc file or the EDITREAD environment variable.
Any keyboard key can be assigned to any editread function
with the following exceptions. Functions enable,
insertspace, and prompt take a toggle value, ON or OFF; two
commands, histsave and histdisplay, take numeric values;
and the term function takes a string value. To disable any
function, set its value to OFF. On the configuration
display, a blank setting implies a disabled condition.
In addition to literal keyboard keys, you can set editread
functions to mnemonic names. These names represent special
Licensed material--property of copyright holder(s) Page 4
editread(5) DG/UX 4.30 editread(5)
keys that generate unprintable characters or that vary from
terminal to terminal; for example, control characters,
function keys, and cursor control keys. See the Special
Keys section for a list of the available names and other
related information.
You reassign values to functions using this format:
function-keyword = value [ function-keyword = value ]
You can use any amount of spacing between keywords and
values for readability. Interactive assignments are
terminated with the reconfig key. When using the EDITREAD
environment variable, put single quotation marks ('') around
the entire list of function keywords and values.
You can temporarily disable editread (for the remainder of a
log-in session) by interactively assigning the OFF value to
the enable function. Or, you can disable editread in one
shell (such as the C shell) while keeping it enabled in the
Bourne shell. To disable editread permanently, you can
delete your .editreadrc file(s), delete or unset the
EDITREAD environment variable, or set the enable function to
OFF (either interactively, in the EDITREAD environment
variable, or in a .editreadrc file).
By default, the line-editing and control keys defined in
editread are copied from your terminal's line discipline.
For example, both editread and your terminal define <Del> as
the erase key and <Ctrl-U>> as the kill (delete-line) key.
If you redefine a key in editread, make the corresponding
change in your line discipline. You can make such a change
with the stty(1) command or in your setup file: .profile
for the Bourne shell and .login for the C shell.
Definitions made in editread and in the line discipline
should be consistent.
Special Keys
Editread recognizes the special keys listed in the two
tables below. Some special keys are provided for all
terminals and are part of the editread default values; these
are listed in the first table. The remainder of the special
keys are not available on all terminals; these are listed in
the second table. For keys listed in the first table, you
can always set an editread function to the mnemonic name of
the key. For keys listed in the second table, however, you
can use mnemonic names for only those keys supported by your
terminal.
Editread accesses the terminfo(4) database to determine
which special keys your terminal supports. For more
information, consult term(5) and terminfo(4).
Licensed material--property of copyright holder(s) Page 5
editread(5) DG/UX 4.30 editread(5)
The following mnemonic names are provided for all terminals:
^C The control form of character C (<Ctrl-C>).
CR The carriage return (enter) key.
DEL The delete (<Ctrl-?>) key.
DOWN The cursor down (down arrow) key.
ESC The escape (<Ctrl-[>) key.
HOME The home key.
LEFT The cursor left (left arrow) key.
NL The newline (linefeed) key.
RIGHT The cursor right (right arrow) key.
UP The cursor up (up arrow) key.
The following mnemonic names are terminal dependent:
BREAK The break key.
BACKSPACE The backspace key.
Fn Function key n, where n is between 0 and 63.
DL The delete line key.
IL The insert line key.
DC The delete character key.
IC The insert character (enter insert mode) key.
EIC The end insert mode key.
CLEAR The clear screen (erase) key.
EOS The clear to end of screen key.
EOL The clear to end of line key.
SF The scroll forward (scroll down) key.
SR The scroll backward (scroll up) key.
NPAGE The next page key.
PPAGE The previous page key.
STAB The set tab key.
CTAB The clear tab key.
CATAB The clear all tabs key.
ENTER The enter (send) key.
SRESET The soft (partial) reset key.
RESET The (hard) reset key.
PRINT The print (copy) key.
LL The home-down key.
A1 The upper left keypad key.
A3 The upper right keypad key.
B2 The center keypad key.
C1 The lower left keypad key.
C3 The lower right keypad key.
BTAB The back tab key.
BEG The beginning (beg) key.
CANCEL The cancel key.
CLOSE The close key.
COMMAND The command (cmd) key.
COPY The copy key.
CREATE The create key.
END The end key.
EXIT The exit key.
Licensed material--property of copyright holder(s) Page 6
editread(5) DG/UX 4.30 editread(5)
FIND The find key.
HELP The help key.
MARK The mark key.
MESSAGE The message key.
MOVE The move key.
NEXT The next object key.
OPEN The open key.
OPTIONS The options key.
PREVIOUS The previous object key.
REDO The redo key.
REFERENCE The reference (ref) key.
REFRESH The refresh key.
REPLACE The replace key.
RESTART The restart key.
RESUME The resume key.
SAVE The save key.
SBEG The beginning (beg) key (shifted).
SCANCEL The cancel key (shifted).
SCOMMAND The command (cmd) key (shifted).
SCOPY The copy key (shifted).
SCREATE The create key (shifted).
SDC The delete character key (shifted).
SDL The delete line key (shifted).
SELECT The select key.
SEND The end key (shifted).
SEOL The clear to end of line key (shifted).
SEXIT The exit key (shifted).
SFIND The find key (shifted).
SHELP The help key (shifted).
SHOME The home key (shifted).
SIC The insert character (enter insert mode) key
(shifted).
SLEFT The cursor left (left arrow) key (shifted).
SMESSAGE The message key (shifted).
SMOVE The move key (shifted).
SNEXT The next object key (shifted).
SOPTIONS The options key (shifted).
SPREVIOUS The previous object key (shifted).
SPRINT The print (copy) key (shifted).
SREDO The redo key (shifted).
SREPLACE The replace key (shifted).
SRIGHT The cursor right (right arrow) key (shifted).
SRSUME The resume key (shifted).
SSAVE The save key (shifted).
SSUSPEND The suspend key (shifted).
SUNDO The undo key (shifted).
SUSPEND The suspend key.
UNDO The undo key.
EXAMPLES
The first and second examples show interactive assignments.
The third example shows the assignment of function-value
Licensed material--property of copyright holder(s) Page 7
editread(5) DG/UX 4.30 editread(5)
pairs to the EDITREAD environment variable in the C shell.
The final example shows the contents of a .editreadrc file.
$ erase = ^?<Ctrl-R>
$ intr=^c histrecall=^z prompt = OFF<Ctrl-R>
% setenv EDITREAD 'prompt=ON gotoend = OFF gotoendov = ^a'<NL>
% cat .editreadrc<NL>
erase = ^?
intr = ^c hist_recall = Esc prompt = ON
hist_disp = 12 reconfig=f1
FILES
/usr/lib/editreadrc.proto Offers a prototype of a
.editreadrc file.
.editreadrc Is read to enable editread at
login for each shell and for other
programs using editread. Multiple
.editreadrc files can reside in
your file system.
.profile Is initialized for the Bourne
shell at login; may contain key
definitions.
.login Is initialized for the C shell at
login; may contain key
definitions.
/usr/lib/terminfo/?/* Provides information about your
terminal and keyboard.
SEE ALSO
crash(1M), csh(1), sh(1), stty(1), terminfo(4), term(5)
Licensed material--property of copyright holder(s) Page 8