The WindSh front end provides a history mechanism similar to the UNIX Korn-shell history facility, including a built-in vi-like line editor that allows you to scroll, search, and edit previously typed commands. Line editing is available regardless of which interpreter you are using (C or Tcl1 ), and the command history spans both interpreters--you can switch from one to the other and back, and scroll through the history of both modes.
You can control what characters to use for certain editing commands. The input keystrokes shown in Table 5-14 (5.3.13 Terminal Control Characters) are set by the host stty command (which you can call from the Tcl interpreter; see 5.7 Tcl: Shell Interpretation). They must be single characters, usually control characters; Table 5-15 includes these characters, but shows only common default values.
The ESC key switches the shell from normal input mode to edit mode. The history and editing commands in Table 5-15 are available in edit mode.
Some line-editing commands switch the line editor to insert mode until an ESC is typed (as in vi) or until an ENTER gives the line to one of the shell interpreters. ENTER always gives the line as input to the current shell interpreter, from either input or edit mode.
In input mode, the shell history command h( ) (described in System Information) displays up to 20 of the most recent commands typed to the shell; older commands are lost as new ones are entered. You can change the number of commands kept in history by running h( ) with a numeric argument. To locate a line entered previously, press ESC followed by one of the search commands listed in Table 5-15; you can then edit and execute the line with one of the commands from Table 5-15.
|
NOTE: Not all the editing commands that take counts in vi do so in the shell's line editor. For example, ni does not repeat the inserted text n times.
|
||||||||||||||||||
1: The WindSh Tcl-interpreter interface is described in 5.7 Tcl: Shell Interpretation.