Do not store same command line multiple times in HISTORY
HISTORY=ON apparently allocates some 576 bytes of memory and use it to keep about 15 commands.
It would be nice for this to be configurable. This would allow to lower the footprint on very, very restrained systems. For example on a 256K machine the user might prefer to set the history to 4 last commands, which would limit the memory usage yet still provide a history buffer that is comfortable most of the time. This could be configured for example through HISTORY=4 ("save last 4 commands only") or HISTORY=100 ("use a 100 bytes buffer for HISTORY"), depending how the history logic is currently implemented.
Another desirable improvement would be for the kernel to not store the same consecutive command. For instance running 3x DIR makes the command to appear 3 times in history.
Source indicates that HISTORY=ON,256 might do the trick (setting history to 256 bytes). The valid range seems to be 128-4096 bytes. But did not test it yet.
;
; This function modifies the History buffer support provided by
; DR DOS the defaults are History OFF, 512 byte buffers,
; Insert ON, Search OFF, Matching OFF.
;
func_history: ; HISTORY = ON|OFF[,NNNN[,ON|OFF[,ON|OFF[,ON|OFF]]]]
The kernel itself gives such hint:
would you know what is the second ON/OFF setting for?
According to the source code the syntax is more elaborate than the kernel's message suggests:
HISTORY=ON_OFF[,MEMSIZE[,INSERT_STATE[,SEARCH_STATE[,MATCH_STATE]]]]
What are INSERT_STATE, SEARCH_STATE and MATCH_STATE remains to be found.
This version of HISTORY was designed exclusively for DR-DOS, Enhanced DR-DOS, OpenDOS, Novell DOS, and its siblings. Not suitable for MS-DOS, PC-DOS and many others.
Generally speaking, HISTORY is usually implemented as a sub function of the DOSKEY external command. However, other DOS implementation such as PTS-DOS and X-DOS have also implemented it explicitly as an external command.
In the DR-DOS family of products, HISTORY is present as a statement in its CONFIG.SYS counterpart. Its syntax is quite cumbersome for average users to comprehend. So, much like the FASTOPEN external command in DR-DOS, this particular implementation of HISTORY helps to clarify its functionality and proper usage.
HISTORY is Public Domain Software. Binary release only.
Ignacio F. Gully HISTORY's author
Anything to do here apart from documenting this stuff?
Improvement suggestion could be summarized as "do not store same command line multiple times in history"?
Anything to do here apart from documenting this stuff?
Ignacio documented it extensively here: http://svardos.org/phpamb.php?fname=help/help-en&f=kerncfg.ama
Improvement suggestion could be summarized as "do not store same command line multiple times in history"?
Indeed, albeit it is a really minor "nice to have" thing - I am not sure it's worth polluting the list of issues with this, so feel free to close & ignore.
The important thing was to have clarity on how it works, and that is nicely covered with Ignacio's contribution to the SvarDOS HELP. :)
Will leave it open, but rename the issue for better clarity.