Powered by QM on a Rpi server
About OpenQM
Sales and Downloads
Help and Support

KnowledgeBase 00084: Command Editor

Last updated: 17 Feb 2017
Applies to: All versions
Top level index       Full Index Search Tips
Previous article     Next article

This article was originally published as a Tip of the Week.


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 HOMEMove cursor to start of command.
Ctrl-B or Cursor LeftMove cursor left one place.
Ctrl-D or DELETEDelete character under cursor.
Ctrl-E or ENDMove cursor to end of command.
Ctrl-F or Cursor RightMove cursor right one place.
Ctrl-GExit from the command stack and return to a clear command line.
Ctrl-KDelete all to the right of the cursor.
Ctrl-N or Cursor DownDisplay "next" command from command stack.
Ctrl-O or InsertToggle insert/overlay mode.
Ctrl-PDisplay "previous" command from command stack.
Ctrl-RSearch 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-TInterchange characters before cursor.
Ctrl-UConvert command to uppercase.
Ctrl-Z or Cursor UpDisplay "previous" command from command stack.
BackspaceBackspace 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:

EPosition the cursor at the end of a recalled command rather than the start.
LUse screen size to determine default number of items in .L command.
OStart in overlay mode.
SShow the stack commands when moving back through the stack.
XClear the recalled command if the first character typed is not a control code. This mode cannot be used with E.

Related Articles


Please tell us if this article was helpful
Very     Slightly     Not at all
Email (optional)