home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 December / simtel1292_SIMTEL_1292_Walnut_Creek.iso / msdos / keyboard / histry61.arc / HISTORY.DOC next >
Text File  |  1989-01-05  |  18KB  |  423 lines

  1.         HISTORY                                            PC Version 6.1
  2.  
  3.  
  4.                                    Description
  5.  
  6.              HISTORY is a program for PC-DOS 2.0 and later (there is also
  7.         a version for the DEC Rainbow) which allows the user to recall,
  8.         edit, and reissue previously-typed DOS commands.  If a mistake is
  9.         made on the command currently being entered but is not noticed
  10.         until after several more characters have been typed, the mistake
  11.         may be fixed without deleting the intervening characters.
  12.  
  13.              Commands are saved in a FIFO buffer.  By default the buffer
  14.         is 512 bytes long; the number of commands that can be saved in
  15.         the buffer depends on their length.  When the buffer becomes
  16.         full, one or more of the oldest commands are evicted to make room
  17.         for a new command.  If a new command is identical to the
  18.         immediately preceding command, it is not duplicated in the
  19.         history buffer.
  20.  
  21.              The user steps back and forth through old commands using the
  22.         up- and down-arrow keys.  Up-arrow recalls the most recent
  23.         command, another up-arrow the second most recent, and so forth.
  24.         Down-arrow moves forward in the buffer.  Both movements are
  25.         circular -- when up-arrow reaches the oldest command another up-
  26.         arrow will return to the current command (the DOS prompt).  An
  27.         initial down-arrow will move to the oldest command.
  28.  
  29.               The left- and right-arrow keys may be used to move within a
  30.         line.  Home moves to the beginning of the line, while End moves
  31.         back to the end.  The Backspace key deletes the character to the
  32.         left of the cursor and the Del key deletes the character under
  33.         the cursor.  Normal characters are inserted into the line.  Other
  34.         editing commands are summarized below.
  35.  
  36.              A line may be recalled by content by typing Alt-S; the user
  37.         is then prompted for an anchored search string.  The history list
  38.         is searched backwards for the line beginning with the specified
  39.         string.  To search for the next-most recent occurrence of the
  40.         string, the user merely hits Alt-F.  As a shorthand for Alt-S,
  41.         Alt-X prompts for a single-character search string without a
  42.         carriage return; the selected command is automatically executed.
  43.         The string seleted by Alt-S or Alt-X is remembered between
  44.         HISTORY invocations.  Subsequent uses of Alt-F use this string
  45.         until another is chosen.  All searches wrap circularly.
  46.  
  47.              Multiple DOS commands may be entered on one line by
  48.         separating them with a semi-colon.  The commands will be sent one
  49.         at a time to DOS.  A semicolon as the last character on the line
  50.         will be sent along (hello, MicroSoft).  To enter a semicolon mid-
  51.         command, type two (one will be sent).
  52.  
  53.              Shift-Tab replaces everything to the right of the cursor
  54.         with the last argument of the previous command in the buffer.
  55.         This is useful for applying successive commands to the same
  56.         argument.  Successive Shift-Tab's move back through the buffer.
  57.  
  58.              Other function key actions are described under "Function Key
  59.         Summary" below.
  60.  
  61.  
  62.                                 Immortal Commands
  63.  
  64.              A set of "immortal" commands may be loaded from a file by
  65.         specifying the file name as an argument when HISTORY is loaded or
  66.         by loading the file interactively with Alt-L.  The commands are
  67.         immortal in that they are not deleted to make room for new
  68.         commands.  The immortal commands remain at the top (oldest) part
  69.         of the buffer and thus are immediately accessible via the
  70.         down-arrow key.  They may be searched for and otherwise treated
  71.         as any other commands.
  72.  
  73.              The buffer is cleared before the file is loaded.  There must
  74.         be at least 64 bytes left after loading for normal mortal
  75.         commands; HISTORY stops loading when this limit is reached.  You
  76.         may increase the buffer size from its default of 512 bytes when
  77.         HISTORY is loaded (see below).
  78.  
  79.  
  80.                                      Aliases
  81.  
  82.              Commands may be given an alias via the syntax
  83.  
  84.                 :alias replacement
  85.  
  86.              Whenever the alias is typed at the start of the line, its
  87.         replacement is inserted in its place and the resulting command
  88.         executed.  For example given the aliases
  89.  
  90.                 :dw dir /w
  91.                 :t type
  92.  
  93.         in the command buffer, typing
  94.  
  95.                 dw
  96.  
  97.         is equivalent to typing
  98.  
  99.                 dir /w
  100.  
  101.         and
  102.  
  103.                 t fred
  104.  
  105.         is equivalent to
  106.  
  107.                 type fred
  108.  
  109.              Alias substitution is only done on the first word of a
  110.         command; multiple commands separated by semicolons will, however,
  111.         have alias substitution applied to each command.  Substitution is
  112.         reapplied until no more aliases are translated, so one alias may
  113.         be defined in terms of another.  If the replacement begins with
  114.         the same name as the alias, however, replacement stops; thus
  115.  
  116.                 :dir dir /w
  117.  
  118.         will not loop recursively but will give the desired result.  To
  119.         prevent alias substitution in commands, precede the command verb
  120.         with a colon.
  121.  
  122.              Aliases are usually loaded from a file of immortal commands
  123.         but may also be established interactively.  Non-immortal aliases
  124.         eventually age and die, however.
  125.  
  126.              If multiple definitions of the same alias exist, the first
  127.         one encountered searching from most recent to oldest is used.  If
  128.         an alias is defined with no replacement string, e.g.
  129.  
  130.                 :dir
  131.  
  132.         then this cancels the effect of older definitions of the same
  133.         alias; in this case dir is no longer an alias for something else.
  134.  
  135.  
  136.                                     Hot Keys
  137.  
  138.              A special case of an alias is the Hot Key.  A command may be
  139.         aliased as a function key.  If the function key is then pressed
  140.         at the beginning of the line, the command is executed without
  141.         waiting for a carriage return.  The alias must be a 2-character
  142.         hex code from the following table:
  143.  
  144.         Key    Code     Key    Code     Key    Code     Key         Code
  145.  
  146.         F1      3B      Alt-F1  68      Alt-A   1E      Alt-Hyphen   82
  147.         F2      3C      Alt-F2  69      Alt-B   30
  148.         F3      3D      Alt-F3  6A      Alt-C   2E
  149.         F4      3E      Alt-F4  6B      Alt-E   12
  150.         F5      3F      Alt-F5  6C      Alt-G   22
  151.         F6      40      Alt-F6  6D      Alt-I   17
  152.         F7      41      Alt-F7  6E      Alt-J   24
  153.         F8      42      Alt-F8  6F      Alt-K   25
  154.         F9      43      Alt-F9  70      Alt-M   32
  155.         F10     44      Alt-F10 71      Alt-N   31
  156.         Sh-F1   54      Alt-1   78      Alt-P   19
  157.         Sh-F2   55      Alt-2   79      Alt-Q   10
  158.         Sh-F3   56      Alt-3   7A      Alt-R   13
  159.         Sh-F4   57      Alt-4   7B      Alt-T   14
  160.         Sh-F5   58      Alt-5   7C      Alt-U   16
  161.         Sh-F6   59      Alt-6   7D      Alt-V   2F
  162.         Sh-F7   5A      Alt-7   7E      Alt-W   11
  163.         Sh-F8   5B      Alt-8   7F      Alt-Y   15
  164.         Sh-F9   5C      Alt-9   80      Alt-Z   2C
  165.         Sh-F10  5D      Alt-0   81      Alt-=   83
  166.  
  167.         These codes are cryptic, but a more user-friendly scheme would
  168.         consume precious dedicated memory.  You may put a comment at the
  169.         end of the alias definition by preceding the comment by zero or
  170.         more spaces followed by two pound signs (##).
  171.  
  172.              As an example, the following alias in the command buffer
  173.  
  174.                 :44 dir  ## F10
  175.  
  176.         would cause the dir command to be executed when F10 was pressed.
  177.  
  178.  
  179.                             Changing the Buffer Size
  180.  
  181.              The default command buffer size of 512 bytes can be changed
  182.         when HISTORY is loaded by specifying as the first argument a dash
  183.         followed by the buffer size (no intervening space), e.g.
  184.  
  185.                     history -1024
  186.  
  187.         The buffer size should be at least 64.  Big buffers allow more
  188.         immortal commands and a bigger window of mortal commands, but
  189.         consume more memory and produce a more verbose buffer listing.
  190.  
  191.  
  192.                                   Installation
  193.  
  194.              HISTORY is enabled by executing HISTORY.EXE once per boot,
  195.         typically from AUTOEXEC.BAT.  It requires about 8K of dedicated
  196.         memory.
  197.  
  198.              The HISTORY command may contain a buffer size argument
  199.         and/or an immortal command file argument:
  200.  
  201.                     history -size file
  202.  
  203.         Both arguments are optional.  See the discussion above for
  204.         details.
  205.  
  206.              HISTORY works by trapping DOS function 0AH.  Since programs
  207.         other than COMMAND.COM also use function 0AH, HISTORY must
  208.         distinguish COMMAND.COM from the crowd.  It does this by
  209.         remembering the address of the very first program to call it
  210.         after it's been loaded; to insure that COMMAND.COM is the first
  211.         caller, make HISTORY the last command in AUTOEXEC.BAT or invoke
  212.         it manually.
  213.  
  214.  
  215.                               Function Key Summary
  216.  
  217.              Up-arrow or    Move back through commands.
  218.              PgUp
  219.              Down-arrow or  Move forward through commands.
  220.              PgDn
  221.              Shift-Tab      Replace everything right of the cursor with
  222.                             the last argument of the previous command.
  223.              Left-arrow     Move the cursor left one character.
  224.              Right-arrow    Move the cursor right one character.
  225.              Home           Move the cursor to the beginning of line.
  226.              End            Move the cursor to the end of the line.
  227.              Ctrl-left      Move the cursor left one word.
  228.              Ctrl-right     Move the cursor right one word.
  229.              Backspace      Delete the character before the cursor.
  230.              Del            Delete the character under the cursor.
  231.              Ctrl-PgUp or   Delete from start of previous word to cursor.
  232.              ^Shift-left
  233.              Ctrl-PgDn or   Delete from cursor to start of next word.
  234.              ^Shift-right
  235.              Ctrl-Home      Delete from the beginning of the line to the
  236.                             cursor.
  237.              Ctrl-End       Delete from the cursor to the end of the
  238.                             line.
  239.              Ins            Toggle insert/overstrike mode (starts each
  240.                             time in insert mode).
  241.              Return         Execute the command (regardless of cursor
  242.                             position).
  243.  
  244.              Alt-S          Select and find search string.
  245.              Shift-Alt-S    Select and find search string and execute.
  246.              Alt-F          Find next occurrence of string (remembered
  247.                             between commands).
  248.              Shift-Alt-F    Find search string and execute.
  249.              Alt-X          Select and find one-character search string
  250.                             and execute.
  251.              Alt-D          Same as typing "EXIT"; useful for leaving
  252.                             secondary COMMAND.COM's.
  253.              Alt-H          Lists the contents of the history buffer,
  254.                             oldest to most recent.
  255.              Shift-Alt-H    Lists the contents of the history buffer,
  256.                             most recent to oldest.
  257.              Alt-O          Disables HISTORY; commands are parsed via
  258.                             normal DOS code until Control-Z followed by
  259.                             Return is typed.  HISTORY remains resident
  260.                             in memory and the command buffer remains
  261.                             intact.  See bug list below.
  262.              Alt-L          Promts for the name of a file of immortal
  263.                             commands and loads that file.
  264.  
  265.              ;              If not the last character on the line, splits
  266.                             DOS commands.  They are handed one at a time
  267.                             to COMMAND.COM.  If last on the line, it is
  268.                             sent along as part of the command.  To send a
  269.                             semicolon mid-command, type two semicolons.
  270.              ^C, ^X or ESC  Delete the line being typed/edited.
  271.  
  272.  
  273.                              Printer Considerations
  274.  
  275.              When printing a file using the standard DOS print spooler
  276.         PRINT.COM, lines are sent to the printer only when awaiting DOS
  277.         input; since HISTORY bypasses DOS input when awaiting command
  278.         input, the printer will stop until a command is run.
  279.  
  280.              Similarly, Control-P (printer toggle) will not be recognized
  281.         in HISTORY.  The solution to both problems is to use Alt-O to
  282.         disable HISTORY long enough for the file to print or to type
  283.         Control-P (once toggled on you may turn HISTORY back on; printing
  284.         will take place in this case).
  285.  
  286.              To reenable HISTORY, type Control-Z followed by Return.
  287.  
  288.  
  289.                                     Know bugs
  290.  
  291.              If HISTORY has been disabled via Alt-O and ^C is typed at
  292.         the DOS command prompt, HISTORY can not be reenabled.
  293.  
  294.  
  295.                                Modification History
  296.  
  297.                                    Version 2.6
  298.  
  299.              A bug which caused the system to hang was fixed.
  300.  
  301.              HISTORY properly handles long lines which wrap around two
  302.         rows.
  303.  
  304.              Searches are now caseless.
  305.  
  306.              The amount of dedicated memory required has been reduced.
  307.  
  308.                                    Version 2.7
  309.  
  310.              A bug associated with ^X was fixed.
  311.  
  312.                                    Version 3.0
  313.  
  314.              Immortal commands added.  Labeled commands added.
  315.  
  316.              If a command is identical to the immediately preceding
  317.         command, the second is not saved in the history buffer.
  318.  
  319.                                    Version 3.1
  320.  
  321.              Fixed a bug which caused immortal commands to be mortal.
  322.  
  323.                                    Version 3.2
  324.  
  325.              Fixed a bug which ocurred when backspacing over the response
  326.         to a prompt.
  327.  
  328.                                    Version 3.3
  329.  
  330.              Added delete-word commands.
  331.  
  332.                                    Version 3.4
  333.  
  334.              Made ^C behave like ^X.
  335.  
  336.                                    Version 3.5
  337.  
  338.              Replaced F10, F9, etc., with Alt keys.  Added Shift-Alt-F
  339.         and Shift-Alt-S.
  340.  
  341.                                    Version 4.0
  342.  
  343.              Labeled commands replaced with aliasing.
  344.  
  345.                                    Version 4.1
  346.  
  347.              Alias substitution applied to semicolon-separated commands.
  348.  
  349.                                    Version 5.0
  350.  
  351.              Added Hot Keys.  Added Shift-Alt-H (lists command buffer in
  352.         reverse order).  Added alias cancel capability.  ^C cancels
  353.         command buffer list.
  354.  
  355.                                    Version 5.1
  356.  
  357.              Translations of hot keys shown when executed.
  358.  
  359.                                    Version 5.2
  360.  
  361.              Fixed a bug wherein a command was not saved in the buffer if
  362.         the command was a substring of the previous command.
  363.  
  364.                                    Version 5.3
  365.  
  366.              Added optional setting of command buffer size when HISTORY
  367.         is loaded.
  368.  
  369.                                    Version 5.4
  370.  
  371.              Aliasing improved.
  372.  
  373.                                    Version 5.5
  374.  
  375.              Made Escape behave like ^X.  Notification when HISTORY
  376.         reenabled.
  377.  
  378.                                    Version 5.6
  379.  
  380.              Added Shift-Tab.
  381.  
  382.                                    Version 5.7
  383.  
  384.              Made Shift-Tab non-destructive to the part of the command
  385.         line left of the cursor.  Ctrl-End now clears commands spilling
  386.         onto a second line.
  387.  
  388.                                    Version 5.8
  389.  
  390.              Ignore Num Lock state.
  391.  
  392.                                    Version 5.9
  393.  
  394.              Fixed a bug where the file handle used to read the file of
  395.         immortal commands was not being closed and thus free after use.
  396.         Fixed a bug involving typing an unmapped function key at the
  397.         beginning of a non-empty line.
  398.  
  399.                                    Version 6.0
  400.  
  401.              Fixed a bug where an alias was not being translated if
  402.         followed immediately by a semicolon.
  403.  
  404.                                    Version 6.1
  405.  
  406.              Reports buffer size when loaded.
  407.  
  408.  
  409.                                   Author, author
  410.  
  411.         Copyright (c) 1985-89 by Bryan Higgins.  All rights reserved,
  412.         except the right to copy for non-commercial use.
  413.  
  414.         The author may be reached/rewarded at
  415.  
  416.                 1802 Channing Way
  417.                 Berkeley, CA 94703
  418.  
  419.         Please specify PC HISTORY version 6.1 when referring to this
  420.         program.
  421.  
  422.         One of the Kramden Utilities.
  423.