KnowledgeBase 00084: Command Editor

Introduction

The command editor records the most recent commands executed by a user from the
command prompt. By default, 99 commands are stored but this can be altered
using the CMDSTACK configuration parameter.

Two styles of command editor are provided; one based on the "dot commands"
found in many multivalue environments, the other using the cursor and
control keys.

The Dot Commands

Except where stated below, the value of n defaults to 1 if ommitted.

.An text

Append text to command stack entry n. There must be a space
before text. Any additional spaces will be included in the appended
data.

.Cn/old/new/G

Change string old to
new in stack entry n.
The optional G causes a global replacement where all occurrences of old
are replaced by new. If G is not specified, only the first occurrence of
old is changed.

.Dn

Delete stack entry n.

.In text

Insert text as entry n. There must be a space before
text. Any additional spaces will form part of the inserted entry.

.Ln

List the most recent n commands. The value of n defaults
to 20.

.Rn

Recall (copy) entry n to position 1 without deleting the original
copy.

.Un

Convert entry n to upper case.

.Xn

Execute command n. The repeated command is copied to position 1
except when executing the current most recent command.

.?

Display a help message regarding the stack manipulation commands.

There are additional dot commands described in the QM Reference Manual.

Using Cursor and Control Keys

Ctrl-A or HOME

Move cursor to start of command.

Ctrl-B or Cursor Left

Move cursor left one place.

Ctrl-D or DELETE

Delete character under cursor.

Ctrl-E or END

Move cursor to end of command.

Ctrl-F or Cursor Right

Move cursor right one place.

Ctrl-G

Exit from the command stack and return to a clear command line.

Ctrl-K

Delete all to the right of the cursor.

Ctrl-N or Cursor Down

Display "next" command from command stack.

Ctrl-O or Insert

Toggle insert/overlay mode.

Ctrl-P

Display "previous" command from command stack.

Ctrl-R

Search back up the command stack for a given string. The string may be entered either before or after the Ctrl-R. Using Ctrl-R again, finds the next item matching the supplied string.

Ctrl-T

Interchange characters before cursor.

Ctrl-U

Convert command to uppercase.

Ctrl-Z or Cursor Up

Display "previous" command from command stack.

Backspace

Backspace one place.

Configuring the Command Editor

Field 3 of the $RELEASE record in the VOC file can be used to control the
behaviour of the command editor. The following uppercase letters may be
present:

E

Position the cursor at the end of a recalled command rather than the start.

L

Use screen size to determine default number of items in .L command.

O

Start in overlay mode.

S

Show the stack commands when moving back through the stack.

X

Clear the recalled command if the first character typed is not a control code. This mode cannot be used with E.