next up previous contents index
Next: Command Completion Up: The WRspice Shell Previous: The WRspice Shell   Contents   Index


Command Line Editing

The WRspice shell contains a line editor system similar to that found in some UNIX shells. The left and right arrow keys can be used to move the cursor within the line of text, so that text can be entered or modified at any point. Pressing the Enter key sends the line of text to WRspice, regardless of where the cursor is at the time. The up arrow key will load the line of text with the previously entered line progressively. The down arrow key cycles back through the history text. Ctrl-E places the cursor at the end of text, Ctrl-A places the cursor at the beginning of the line. Bsp (backspace) erases the character to the left of the cursor, Delete deletes the character at the cursor, and Ctrl-K will delete from the cursor to the end of the line. Ctrl-U will delete the entire line.

The following keys perform editing functions:

Ctrl-A Move cursor to beginning of line
Ctrl-D List possible completion matches
Tab Insert completion match, if any
Ctrl-E Move cursor to end of line
Ctrl-H or Bsp Erase character to left of cursor
Ctrl-K Delete to end of line
Ctri-U Delete line
Ctrl-V Insert following character verbatim
Delete Delete character at cursor
Left arrow Move cursor left
Right arrow Move cursor right
Up arrow Back through history list
Down arrow Forward through history list

By default, command line editing is enabled in interactive mode, which means that WRspice takes control of the low level functions of the terminal window. Command line editing can be disabled by setting the noedit variable (with the set command). If the terminal window doesn't work with the editor, it may be necessary that ``set noedit'' appear in the WRspice startup (.wrspiceinit) file. When noedit is set, the command completion character is Esc, rather than Tab.

Some terminals may not send the expected character or sequence when one of these keys is pressed, consequently there is a limited key mapping facility available. This mapping is manipulated with the mapkey command, which allows most of the keys and combinations listed above to be remapped.

Unless WRspice can read the system terminfo/termcap data it needs, it will not allow command line editing, and a warning message will be issued. This may mean that the TERM or TERMINFO environment variables are not set or bogus, or the system terminal info database is incomplete or bad. One can enter alternative terminal names with the -t command line option to potentially fix this problem. The non-editing mode is like a standard terminal line, where backspace is available, but the arrow keys and others that move the cursor have no special significance. This is the mode used when ``set noedit'' is given.


next up previous contents index
Next: Command Completion Up: The WRspice Shell Previous: The WRspice Shell   Contents   Index
Stephen R. Whiteley 2022-09-18