next up previous contents index
Next: Viewing and replaying the Up: The command history Previous: The command history

Introduction

Each line of input that you type in from the keyboard is retained in a a list called the command history . The following rules apply to what is retained.

  1. Line continuations (using the & character) are interpreted in the natural way: that is, the concatenation of the appropriate text is stored as a single line in the command history .
  2. The input line is retained without any parsing whatsoever, so that input lines which include features such as [ ...] which might ordinarily be replaced by other text (see §1.4.2) retain these features unparsed.
  3. The maximum number of input lines retained depends upon a fixed number (set at compile time) whose value can be seen inter alia by issuing the LOOK:  command with the program  argument. Whenever the command history becomes full, the older half is removed.
  4. Each input line retained in the command history has a unique address which we can refer to for editing.
  5. Empty lines are not retained in the command history.
  6. There are two particular commands, the !:  and /:  commands, which act only on the lines retained in the command history . The former views the command history  and replays old command lines as fresh input, and the latter removes input lines from the command history . The input lines containing these commands and their arguments are never retained in the command history .
  7. The input lines which form the command history  can be retained optionally on a file which we call the history file , which is described and set up using the history  argument to the KEEP:  command.
  8. The RESTART:  command empties the command history , and flushes it to the history file  if necessary. The CLEAR:  command leaves alone both the command history  and the history file .

The two commands used with regard to the command history  are special, and treated unlike standard BD commands. They consist of the !:  and /:  commands, which are used for replaying, viewing and deleting keyboard input. These commands are issued like ordinary commands, but are extraordinary because they must appear as described, without assuming parsing of the input line (their arguments, however, are subject to parsing in the usual way). This means that you may not use one of these two commands as the result of a string. An additional feature is that they do not themselves appear as items in the command history. Unlike most other [B/D] commands, these commands are not renameable. Each command can be followed optionally by a colon or a space (as for standard commands) but need not be. Furthermore, these commands must be issued as the first non-space character on a line: for example, you may not issue such a command as the second command of a multiple line.

Neither of these commands ever appears in the command history (see below.) However, the !:  command can result in the replay of a previous line input from the keyboard which will be added anew to the command history.


next up previous contents index
Next: Viewing and replaying the Up: The command history Previous: The command history

David Wooff
Wed Oct 21 15:14:31 BST 1998