Using the Terminal Interactively
This chapter describes the basics of how you work with the Terminal in interactive mode.
Entering Commands
To enter a command in the Terminal, simply type an ObjectScript command and its arguments. Or, if you are using a shell, type a command applicable to that shell.
Note that for ObjectScript, you do not need to enter a space before the command (in contrast to when you define routines and methods).
Also note that if you start a line in the Terminal by pressing Tab, the rest of that line is entered into the routine buffer and is not executed. This behavior was defined long ago and was a useful way of creating routines. (Also see the ZINSERT command, which serves the same purpose.) Because customers no longer define routines this way, this documentation does not discuss this feature further.
Scrolling
Whenever active text arrives, the Terminal scrolls the window to the newly arrived text. Use the scroll bar on the right to scroll up or down.
You can also use the keyboard to scroll within the Terminal as follows:
Key Combination | Effect |
---|---|
Ctrl+Home | Scroll to the top of the buffer. |
Ctrl+End | Scroll down to the cursor. |
Ctrl+Page Up | Scroll up by one page. |
Ctrl+Page Dn | Scroll down by one page. |
Ctrl+Line Up | Scroll up by one line. |
Ctrl+Line Dn | Scroll down by one line. |
Pausing and Resuming the Terminal Scrolling
To pause the scrolling in Terminal, press Ctrl+S. While scrolling is paused, the Terminal accepts commands and processes them, but it does not write the commands or any output to the screen (and thus appears to be unresponsive).
To resume, press Ctrl+Q.
Repeating Previous Commands
To repeat a previous command, press the up arrow key repeatedly until the desired command is displayed. To enter the command, press Enter as usual.
Alternatively, you can issue the command :history (or :h) to obtain a numbered list of the commands which you have issued during the current Terminal session. To repeat any command from this list, issue the command :<number>, where <number> is the number corresponding to the command on the list.
The command :clear clears the history buffer, making impossible to recall previous commands using either of these methods.
Creating Aliases for Commonly Used Commands
To define a shortcut for issuing a command, enter the :alias command followed by the alternative name you want to assign to the command (the alias) and then the command you want to assign to that alias. For the rest of the Terminal session, you can issue the command by invoking the alias, preceded by the : character.
In the example session which follows, the :alias command issued in the first line allows the user to switch to the USER namespace in the second line by simply entering the string :u:
%SYS>:alias u set $namespace="USER"
%SYS>:u
USER>
It is also possible to pass arguments to a command using an alias. As part of the alias definition, include numbered host variables prefixed by the $ character as placeholders for each argument in the command. Then, invoke the alias followed by the values of the arguments in the order indicated by the host variable numbers.
For example, issuing the following command creates a shortcut (load) to load a file at a location which will be provided as the first argument ($1)with flags specified by the second argument ($2):
USER>:alias load Do $System.OBJ.Load("$1","$2")
To use this alias to load a file found at the path /directory/foobar.xml with the c and k flags, you can now simply enter the following:
USER>:load /directory/foobar.xml ck
The placeholder variables in a command can also be part of an ObjectScript expression. For example, the following command uses the $SELECT function to set "ck" as the default second argument when no second argument is provided:
USER>:alias load Do $System.OBJ.Load("$1", $S("$2"="":"ck", 1:"$2"))
To remove an alias definition, enter the command :unalias followed by the alias name. Enter :alias with no arguments to see a list of the aliases defined in the current Terminal session.
If you are using a UNIX® or Linux system, you can provide a list of alias definitions which the Terminal will set automatically at the start of every session. Define these aliases (one per line) in a file named .iris_init in the home directory.
Copying and Pasting Text
You can copy and paste text in the Terminal. To do this, you can use the context menu (right-click menu), the Edit menu, or various keyboard shortcuts. The following options are available:
-
Copy copies the selected text to the clipboard.
-
Paste pastes the contents of the clipboard, line by line, to the current position of the cursor (which is the end of the Terminal scrollback buffer). The text becomes visible in the Terminal window unless echoing has been disabled.
-
Copy + Paste copies the selected text to the clipboard and then pastes it, line by line, to the current location of the cursor.
Keyboard Shortcuts
You can use the following keyboard shortcuts:
Action | Basic Shortcut | Windows Shortcut |
---|---|---|
Copy | Ctrl+Ins | Ctrl+C |
Paste | Shift+Ins | Ctrl+V |
Copy and paste | Ctrl+Shift+V |
The shortcuts listed in the “Basic Shortcut” column are always enabled.
The shortcuts listed in the “Windows Shortcut” column are enabled only if you set the Windows edit accelerators option to Yes; for information on this setting, see the section “User Settings,” in the chapter “Controlling the Appearance and Behavior of the Terminal.”
Notes about Copying and Pasting
-
As noted above, if you set the Windows edit accelerators option to Yes, Ctrl+C copies the selected text to the Windows clipboard. To interrupt the Terminal, you must instead press Ctrl+Shift+C
-
If the host has a mouse request outstanding and you wish to do a local cut and paste, press Ctrl while selecting the region; that mouse action is not reported to the host.
-
If the copied text includes a line boundary, it is saved on the clipboard as a carriage return and a line feed. If you do not want to paste line feeds, see “User Settings.”
-
The Terminal can often paste data faster than a host can accept it. See “User Settings” for settings to control the speed of pasting. Also, line feeds can be discarded during a paste command.
Printing
To print from the Terminal, use the following options of the File menu:
-
To select a printer and set it up for use with the Terminal, select File > Printer Setup.
-
To print the contents of the Terminal screen, select File > Print.
-
To print the log file (or any other ASCII file), select File > Print Log. This option lets you select the file to print, and it does no special processing except to try to be reasonable in processing form feed characters. During printing, mouse and keyboard input is locked out of the main window and a cancel dialog box appears. Printing is done in draft mode.
Clearing the Screen
The Edit menu provides two different options to clear the screen:
-
To reset the screen, select Edit > Reset. This option resets the margins, scroll region and other processing on the current page, and causes the Terminal to repaint the window.
-
To reinitialize the screen, select Edit > Erase or press Ctrl+Del. This option reinitializes the Terminal window, erases all session data, and resets the scrollback region to zero.
Logging the Terminal Session
To start logging the Terminal session:
-
Select File > Logging or select Alt+L.
The Terminal displays a dialog box to prompt you for the location and name of the log file. The default directory is install-dir/mgr. The default filename is TERMINAL.LOG.
The total length of the path and file name cannot exceed 126 characters.
-
Optionally specify a different directory and filename.
-
Select OK.
If the log file exists, the Terminal asks if you want to overwrite it and presents three choices:
-
Yes overwrites the file with the new log data
-
No appends any new log data to the file
-
Cancel leaves the file as is (no logging is done)
-
Later, to stop logging, select File > Logging or select Alt+L. The Terminal displays a dialog box to indicate that the log file is closed; select OK.
The log file contains only the output from a connection (independent of the current wrap mode).
You can also perform logging from a Terminal script, as described later in this book. Note that if you have started logging by using File > Logging, you cannot start a script that also performs logging. If you attempt to do so, the behavior is indeterminate.
Also see the section “Learning Mode” in the chapter “Advanced Topics in Terminal Usage.”