Skip to main content

Advanced Topics (Terminal Application)

This topic discusses advanced subjects applicable to the Terminal application. See also Customizing the ObjectScript Shell, which has options specific to the ObjectScript shell.

Escape Sequences That Affect the Terminal Window

The Terminal application supports the following escape sequences, which affect or provide information about the Terminal window:

Sequence Effect
ESC [ 1 t Restore window.
ESC [ 2 t Minimize window.
ESC [ 11 t Report window state.
ESC [ 8;rows;columns t Set window size.
ESC [ 18 t Report window size.
   

The window state is reported in $ZB of the following READ command as:

  • normal: ESC [ 1 t

  • minimized: ESC [ 2 t

If rows or columns is 0 in the set command, the current value is not changed. Range of values supported is rows: 10-120, columns: 10-160.

The window size is reported in $ZB of the following READ command as ESC [ 8;rows;columns t

One consequence of changing the size is that the scroll-back buffer is cleared by the reset. Another is that for larger row values the font size is decreased to make the window fit on the screen.

Also, the following sequence sets the window title:

OSC 2; title ST

Where:

  • OSC, Operating System Command, is the 7-bit sequence ESC ] or the 8-bit character $C(157).

  • ST, String Terminator, is the 7-bit sequence ESC \ or the 8-bit character $C(156).

The maximum length of the title is 80 characters.

For example, the following statement changes the title of the Terminal window:

 write $C(157)_"2;a new title"_$C(156)

Key Timing Mode

To enter or exit key timing mode, press Alt+Shift+T.

This mode can help you determine performance of a host system under various load conditions. The output of a timing run is the file KEYTIMER.LOG in the system manager’s directory.

Learning Mode

In learning mode, the Terminal application generates a log file that you can quickly convert to a script file, after making only minor edits. When this mode is enabled, the log file is a sequence of script wait for and send commands. The wait for commands show up to 16 characters preceding the sent data.

To enter learning mode:

  1. Press Alt+L to enable logging. Then specify a log filename and directory, as described in Logging the Session.

  2. Press Alt+Shift+L.

To exit learning mode, press Alt+Shift+L.

Disabling the Close Button of the Terminal

If you need to disable the close button (X) of the Terminal application, add a registry key, as follows:

  • On 32–bit Windows machines: HKEY_LOCAL_MACHINE\SOFTWARE\InterSystems\Terminal\NoExit

    Notice the space in “Terminal”.

  • On 64–bit Windows machines:

    HKEY_LOCAL_MACHINE\SOFTWARE\ Wow6432Node \InterSystems\Terminal\NoExit=1

The NoExit value is of type REG_SZ in both cases.

Mapping of the Extended Keyboard

The Terminal application supports application keyboard mode for the extended keyboard as follows:

Key Mapped Value
Num Lock PF1
Keypad-divide PF2
Keypad-times PF3
Keypad-minus PF4
Keypad-plus Keypad-comma
Shift+Keypad-plus Keypad-minus
F1, F2, F3, F4 PF1, PF2, PF3, PF4 (respectively)
Shift+F1 ... Shift+F10 F11 ... F20 (respectively)

The keypad cluster of the extended keyboard is mapped as follows:

Key Mapped Value
Insert Insert Here
Home Find
Page Up Prev Screen
Delete Remove
End Select
Page Down Next Screen

The Pause key acts as a single XON/XOFF toggle key.

Using the Terminal application with DDE

The Terminal application supports DDE (Dynamic Data ExchangeOpens in a new tab) links to permit other applications to talk to a remote host. This section assumes that you are familiar with DDE. The topics here are as follows:

  • Layout — Used to obtain status information. Examples are the row and column size, whether there is a connection, and so on.

  • Screen — Used to gather data from the Terminal application screen.

  • Message — Used to send data to either the Terminal application screen or the host.

Note:

A Windows task cannot discriminate between multiple instances of the Terminal application when it comes to using DDE. Therefore, use DDE only if one copy of the Terminal application is running.

DDE Layout Connections

The Terminal application supports DDE requests for what could be considered as static information through the Layout topic.

Item Meaning of Returned Value
Column The number of columns of the window.
Row The number of rows of the window.
hWnd The decimal equivalent of the main window handle.
Connected A null string if there is no connection, otherwise the equivalent of the title string "mode: node"
Read A 1 if the last received character was a CTRL/A. Its use is detection of the end of screen painting.
Script A 1 if a script is currently running, otherwise 0.
Title The title of the window.

DDE Screen Connections

The Terminal application supports DDE requests for screen data through the Screen topic. Currently, one POKE command is available to select which part of a screen line is desired.

Item Meaning of Returned Value
Cursor The current position of the cursor, in the form row;col.
Line The current line (without a CR LF).
LeftLine The left part of the current line up to but not including the character under the cursor.
RightLine The right part of the current line including the character under the cursor.
All The entire screen, each line is delimited by CR LF.
Piece The currently selected piece of a screen line (without a CR LF).
Note:

The item "Piece" can be POKEd with a string of the form "RnnCmmLpp" to cause the Piece request to retrieve (at most) pp characters on the screen line nn beginning with column mm. The top left corner of the screen is row 1, column 1.

DDE Message Connections

The Terminal application supports DDE requests for data communications through the Message topic. These are implemented with DDE POKE commands.

Item Meaning of returned value
Send The DDE message value is sent to the host if a connection is active.
Display The DDE message value is sent to the "screen" as if it were received from the host.
FeedbackOpens in a new tab