Using the Terminal Interactively
This chapter describes the basics of how you work with the Terminal in interactive mode. It covers the following topics:
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.
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:
|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.
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.
You can use the following keyboard shortcuts:
|Action||Basic Shortcut||Windows Shortcut|
|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.
To print from the Terminal, use the following options of the File menu:
To select a printer and set it up for use with 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.
Caché displays a dialog box to prompt you for the location and name of the log file. The default directory is the Caché system manager’s directory. The default filename is CACHETRM.LOG.
The total length of the path and file name cannot exceed 126 characters.
Optionally specify a different directory and filename.
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. Caché 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.