Dec 312017
 
Adds VMS-like history to MS/DOS.
File HISTORY.ZIP from The Programmer’s Corner in
Category Utilities for DOS and Windows Machines
Adds VMS-like history to MS/DOS.
File Name File Size Zip Size Zip Type
HISTORY.C 14203 3257 deflated
HISTORY.COM 3654 2443 deflated
HISTORY.DOC 6528 1992 deflated
MAKEFILE 200 102 deflated
SETUP.ASM 1453 601 deflated

Download File HISTORY.ZIP Here

Contents of the HISTORY.DOC file


HISTORY.DOC Version 1.0 7 December 86 Page 1


Copyright 1985-6 Michael M Rubenstein

This software and the accompanying documentation may be
distributed freely for noncommercial use.



Description.

HISTORY is a history processing terminate and stay resident
program. It provides the ability to recall and edit previous
commands and allows much more sophisticated editing than is found
in the normal MSDOS system.

HISTORY includes a search mechanism to handle relatively large
histories.



Requirements.

HISTORY requires about 4700 bytes of memory plus whatever is
required for the history storage.



Running HISTORY.

HISTORY takes one optional argument on the command line -- the
number of bytes (256 - 32767) to use for history storage. If no
argument is supplied, the minimum, 256, is used. If a number
less than 256 is given, it is silently treated as 256. If a
number larger than 32767 is given, it is silently treated as
32767. The history buffer is circular; i.e, when space is
exhausted the oldest commands are deleted. A value of 1000-2000
is generally appropriate.

Entering commands with HISTORY is similar to doing so in the standard
command processor, but there are numerous additional editing
options.

Left arrow - Back one character.

Right arrow - Forward one character.

Ctrl left arrow - Back one word.

Ctrl right arrow - Forward one word.

Home - Go to start of line.

End - Go to end of line.

Del - Delete current character.
HISTORY.DOC Version 1.0 7 December 86 Page 2


Backspace - Delete previous character.

Ctrl Q - Remove any special meaning from the
next character. For example, Ctrl Q
Ctrl H inserts a Ctrl H (backspace)
into the line.

Ctrl T - Delete to beginning of next word.
F10

Ctrl W
F9 - Delete back to beginning of word.

Ctrl U - Delete entire line.
Ctrl X
Esc

Ctrl Y - Delete to end of line
F8

Ins - Toggle insert mode.

The command will be processed when RETURN or ENTER is pressed.
The cursor need not be at the end of the line.

The real power of HISTORY, however, is in the ability to recall
and edit previous command lines. This is controlled by several
additional command keys:

Up arrow - Recall previous command line. Repeated
application gets successively earlier
command lines. If there is no previous
command line (or it has not been kept
in the history), the bell will sound.
The Ctrl U, Ctrl X, and ESC editing
commands reset the internal pointer to
the end so the next up arrow gets the last
command line executed again.

Ctrl L - Searches for a previous command line
F7 which matches the current line to the
left of the cursor. Case is
immaterial. If none is found, the bell
will sound. For example, if the
previous command lines were

dir
ws test.doc
type whatever.c
whatever
ws what.out
dir

then typing w Ctrl L would recall the
command "ws what.out". The cursor is
HISTORY.DOC Version 1.0 7 December 86 Page 3


left after the "w", so typing Ctrl L
again would recall "whatever". If ws
Ctrl L were typed initially, the
"whatever" command would be skipped and
the two "ws" commands would be
recalled.
Down arrow - Recalls the next command (assuming a
previous command has been recalled with
up arrow and is being edited). If
there is no next command, the bell
sounds.

While the editing commands may seem a bit complex at first, a
little playing at the terminal will make them very natural and
easy to use. The Ctrl L command, in particular, is quite
different from the commands found in most editors. With a very
little practice, command line editing with HISTORY becomes almost
automatic and one soon wonders how one lived without it.

Except for the history commands, the editing commands are
available in any program (e.g., DEBUG) which uses BDOS function
10 for input. The history commands are only available from the
command processor.



For the Hacker.

HISTORY was written in C and compiled with the Aztec C. Source
code is included. A small assembly language interface is used to
make the program memory resident and communicate with the get
console buffer interrupt. The C code is fairly standard and
should be reasonably easy to convert to other versions. The
assembly language interface will require more work if another C
compiler is used.




 December 31, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)