TEXTCMD front-endTEXTCMD maintains a list of the lines of text that have been entered in interactive mode. Newly entered lines are appended to the list, as long as they are the same length as or longer than the minimum length threshold set with the /MINHISTLEN option. If the number of lines entered exceeds a specified maximum number, set with the /MAXHIST option, further new lines appended to the list cause the first line to be scrolled off the top of the list and be discarded.
The keys used to finish editing each line are:
Lines may be recalled from this list to the editing buffer in order to re-execute commands. Conceptually, there exists a pointer to the list that indicates where in the list the next commands will be recalled from. For example, in the following figure the current position is the second line in the list.
First command line Second command line ← Current position Third command line
The editing keys used to recall command lines are:
The /WRAPHISTORY option controls whether motion wraps around the ends of the history list.
If the /MATCHHISTORY option is not set, the current line position always moves by exactly one line when these keys are pressed. If the /MATCHHISTORY option is set, the current line position moves in the selected direction until it reaches a line which begins with the currently entered matching prefix, runs into the end of the history list (if wrapping is off), or circles around to reach the initial position once again (if wrapping is on). The currently entered matching prefix is the content of the editing buffer as it was the last time that it was modified other than by command line recall.
If the append to history option is not set, then if a recalled command line is re-executed without being modified it is not added to the list a second time and the current position is retained. Thus one can re-execute a sequence of commands in the list by repeatedly pressing the DOWN arrow key followed by RETURN. This matches the behaviour of the old CED utility for DOS.
If the append to history option is set, then recalled commands that are re-executed without being modified are added to the list a second time and the current position is reset to the bottom of the list. This matches the behaviour of the 16-bit CMD supplied with IBM OS/2.
When a new command line is entered or when a line is recalled from the history list and the edit buffer is then modified before RETURN is pressed (which is treated as a new command), the new line is always appended to the list and the current position is always reset to the bottom of the list.
The editing keys used to modify the contents of the editing buffer itself are:
Any characters entered will either overtype existing characters or be inserted before the character at the position of the cursor, according to whether the console INSERT state is on or off.
Note: This INSERT state is maintained by the console subsystem itself, not by TEXTCMD. Just like the shift lock key states, it is global across all processes that share a single console. It can be altered programmatically from a command script by using the KEYLOCKS command.
The first time that TAB or SHIFT+TAB are used after the cursor has been moved or the line modified, the current line is parsed (obeying the quoting conventions but treating metacharacters as ordinary characters) to find the word that immediately precedes the cursor. This word is treated as a search wildcard specification and a list of the matching file and directory names is created. TAB and SHIFT+TAB, as long as the cursor is not moved or the line is otherwise modified, then cycle backwards and forwards through that list one entry at a time, replacing the pattern with one of the file or directory names that was found.
The names of any directories that are found have a slash character appended to them, unless the /NOSLASHDIR option was used when starting the command interpreter.
Because it uses low-level console I/O, TEXTCMD will be unaffected by any ANSI CSI escape sequences sent to the console that reprogram function keys.