PreviousNext

Editing the Current Command Line

You can edit a command line before sending it to the dcecp by typing control characters or escape sequences that resemble ksh or emacs editing commands. A control character, shown as a <Ctrl-x> where x is a letter, is typed by holding down the <Ctrl> (or <Control>) and pressing the letter key.. For example, <Ctrl-A> is <Ctrl> and <A>, pressed at the same time. Enter an escape sequence by pressing <Escape> followed by one or more characters. In an escape sequence, <Escape> is referred to as ESC, as in <ESC f> for example. Case matters in escape sequences (unlike control characters, which do not distinguish between upper and lower case); <ESC F> is not the same as <ESC f>.

You can enter an editing command anywhere on the line, not just at the beginning. In addition, a return may also be typed anywhere on the line, not just at the end.

Most editing commands accept a repeat count, n, where n is a number. Enter a repeat count by pressing <Escape>, the number, and then the command to execute. For example, <ESC 4> <Ctrl-f> moves forward four characters. Some of the descriptions that follow includeare marked with [n] to identify commands that accept a repeat count.

The following control characters are accepted:

<Ctrl-A> Move to the beginning of the line
<Ctrl-B> Move left (backward) [n]
<Ctrl-D> Delete character [n]
<Ctrl-E> Move to end of line
<Ctrl-F> Move right (forward) [n]
<Ctrl-G> Ring the bell
<Ctrl-H> Delete character before cursor (<Backspace>) [n]
<Ctrl-I> Complete filename (<Tab>); see following text
<Ctrl-J> Done with line (<Return>)
<Ctrl-K> Kill to end of line (or column [n])
<Ctrl-L> Redisplay line
<Ctrl-M> Done with line (alternate <Return>)
<Ctrl-N> Get next line from history [n]
<Ctrl-P> Get previous line from history [n]
<Ctrl-R> Search backward (forward if [n]) through history for text; must start line if text begins with an up arrow
<Ctrl-T> Transpose characters
<Ctrl-V> Insert next character, even if it is an edit command
<Ctrl-W> Wipe to the mark
<Ctrl-X> <Ctrl-X> Exchange current location and mark
<Ctrl-Y> Yank back last killed text
<Ctrl-[> Start an escape sequence
<Ctrl-]>C Move forward to next character C
<Ctrl-?> Delete character before cursor (<Delete>[n])
The following escape sequences are provided.

<ESC> <Ctrl-H> Delete previous word (<Backspace>) [n]
<ESC DEL> Delete previous word (<Delete>) [n]
<ESC SPC> Set the mark (<Spacebar>); see <Ctrl-X> <Ctrl-X> and <Ctrl-Y>
<ESC .> Get the last (or nth) word from previous line
<ESC ?> Show possible completions; see following
<ESC <> Move to start of history
<ESC >> Move to end of history
<ESC b> Move backward a word [n]
<ESC d> Delete word under cursor [n]
<ESC f> Move forward a word [n]
<ESC l> Make word lowercase [n]
<ESC u> Make word uppercase [n]
<ESC y> Yank back last killed text
<ESC w> Make area up to mark yankable
<ESC nn> Set repeat count to the number nn
In some cases, existing terminal key bindings take precedence over these dcecp control keys. In particular, the bindings used for erase, kill, eof, intr, quit, and susp in your environment will supersede any dcecp bindings for those same control keys. In most instances, control keys will not be interpreted by the terminal but will be passed through to dcecp. One of the few exceptions is lnext (literal next), which quotes the next character typed. When you type the control key that is bound to lnext, it is interpreted by the terminal, which will pass the next character typed through to dcecp.

The dcecp program also provides filename completion. Suppose the root directory has the following files in it:

bin vmunix
core vmunix.old

If you type rm /v and then press <Tab>, the command processor completes as much of the name as possible off by adding munix. Because the example name is not unique, it beeps. If you press <Escape> followed by the ? (question mark), it displays the two choices. The command processor completes the filename when you then enter the period (which makes the name unique) followed by a <Tab>, as shown in the following:

rm /v[Tab]munix.[Tab]old

In this example, the constant width font indicates text automatically entered by the command processor.