4 Input-line Editing

 4.1 Input-line Recall
 4.2 Suggested Value Recall
 4.3 Filename completion
 4.4 Editing the Input Line
 4.5 Other Special Keys

When you reply to prompts from either an ADAM program or ICL, previous input can be recalled and edited – automatic filename completion is also possible in much the same way as it would be on the shell command line. At prompts for ADAM program parameters, you can also paste the suggested value into the input buffer and edit it. The maximum length of an input line is 256 characters – the terminal will beep if you attempt to input more.

Line recall and editing for ADAM uses virtually the same keys as tcsh with the emacs key bindings.

4.1 Input-line Recall

This is achieved using the up and down arrow keys – the recalled line can then be edited in the normal way. Up to a maximum of 100 input lines will be remembered but in the case of programs run from the shell, only responses to prompts in the current invocation of the program can be recalled.

4.2 Suggested Value Recall

If there are no characters on the input line, the TAB key (or ESC,ESC) will cause the suggested value (if any) to be inserted as the input line. It can then be edited in the normal way. (There will be no suggested value at the ICL> prompt.)

See Filename Completion (Section 4.3) for the effect of these characters if there is already some input on the line.

4.3 Filename completion

If there are currently characters on the input line, the TAB key (or ESC,ESC) will cause filename completion to be attempted on the word preceding the cursor. If no match is found, “No match.” will be printed and the terminal will beep; if more than one match is found, “Multiple matches.” will be printed and the terminal will beep – the input line will be set to the longest common prefix. A list of all possible matches can be displayed by typing ESC,CNTL/D. (At the end of line, just CNTL/D is sufficient – elsewhere CNTL/D will delete the character at the cursor.)

To overcome the problem of Starlink NDF and HDS filenames usually being required without the .sdf extension, .sdf will be omitted from the end of any completed filename. This behaviour may be altered by setting environment variable ADAM_EXTN to a comma-separated list of extensions (in fact any strings) which are to be omitted from the end of completed filenames. If no truncation of filenames is required, ADAM_EXTN should be set to a null string.

When a single match is found, the filename is truncated if required and copied to the input line followed by a single space.

For example, suppose the default for filename truncation (.sdf) is in use and the current directory contains two files file.dat and file.sdf. The dialogue might go as follows (<> indicates typing by the user):

  Give NDF name > <x><TAB>
  No match.[beep]
  Give NDF name > <f><TAB>
  Multiple matches.[beep]
  Give NDF name > file.<CNTL/D>
  file.dat    file.sdf
  Give NDF name > file.<s><TAB>
  Give NDF name > file <Return>
  Give auxiliary data file name > <file.d><TAB>
  Give auxiliary data file name > file.dat <Return>

(The last four lines would appear as two lines on the terminal, the second and fourth overwriting the first and third respectively.)

4.4 Editing the Input Line

The left and right arrows and the delete key may be used as expected to edit the current input line. Input is always in ‘insert’ rather than ‘overwrite’ mode.

Key sequences for more complex line editing are given in Appendix F.

4.5 Other Special Keys

CNTL/Z
This will suspend the program in the normal way. It may be re-started with the fg command.
CNTL/C
This will abort a task running from the shell. If running ICL, the effect depends on what is happening at the time. Generally, ICL itself will keep running but the current activity will be aborted (see SG/5 for information on ICL exception handling).