C H A P T E R 8 |
Configuring a UNIX Terminal |
This chapter provides information about configuring UNIX terminals for use with Sun MTP. It includes the following topics:
IBM 3270 keyboards have keys that control the terminal and generate attention identifiers (AIDs) to the CICS application, controlling the transaction program's execution. Most terminals have function keys that send sequences of multiple characters.
There are several ways to make UNIX terminals act like 3270 devices.
Sun MTP supports standard terminals by providing key files for different types of terminals.
If you are using a personal computer with terminal emulator software, select one of the VT emulations from the setup menu so that Sun MTP can run correctly.
For each terminal type, there is a default keyboard file that has the same file name as the name used in the TERM environment variable, plus the .key suffix. Some terminals support several optional keyboards having different numbers of keys and layouts. For these types of terminals, additional keyboard layouts are defined in files with .key suffixes in the $UNIKIX/lib directory.
Sun MTP automatically locates and loads the default key files. If your terminal does not use the default keyboard, you must explicitly define the keyboard type using the -k option to the unikix command when starting the local client. X term clients usually execute Sun MTP with the TERM environment variable set to xterms.
The following command starts a local client for an NCD 97-key keyboard:
Note - The key files are used for UNIX terminals only. They are not used for 3270 SNA device support. |
For user convenience, Sun MTP uses some of the keys in the numeric keypad as control keys. Whenever possible, keyboard definitions retain the numeric, add, subtract and decimal point keys on the numeric keypad. When a terminal has insufficient function keys, you can define manually entered multiple key sequences. For example, you can define a back tab function as the two-character sequence Escape, Tab. You can modify the supplied definitions or add new terminal types to suit your specific requirements by modifying the definition of the key files, changing their names, and storing them in the site-specific options directory structure, $UNIKIX/local.
Use the kixkeydef utility to create or modify a key file that contains the definitions for your keyboard. You can provide up to five definitions for each key. However, you can only define or edit the first two on the kixkeydef screen. If there are more than two definitions for a key, an asterisk is displayed beside the key definition. To change these definitions or add more definitions, you must edit the key file itself. See Editing a Key File Directly for directions.
1. Ensure that the region is not running.
2. Run the kixkeydef utility from a shell prompt to display the kixkeydef screen.
To create a key file called myterm.key in the current directory, type:
If you are editing an existing file, the definitions are displayed. If you are creating a new file, a blank screen similar to the one shown in FIGURE 8-1 is displayed. The name of the key file is displayed in the lower right corner of the screen, if you provided one.
3. Move the cursor to the key you want to define.
The following keys move the cursor on the kixkeydef screen:
h: Moves one field to the left
l: Moves one field to the right
4. Press c to indicate a change.
5. Press the key you are defining.
6. Press the Return key to end the change.
7. Repeat Steps 3 through 6 for each key you define.
8. Press w when you are done to write the new key file to disk.
9. Press x to exit the kixkeydef utility.
10. Move the new key file to either $UNIKIX/lib or $UNIKIX/local/lib:
11. Restart the local client using the -k option to specify your key file, for example:
1. On the kixkeydef screen, move the cursor to the desired key location.
2. To define the Return key, press c, type \r, then press Return.
3. Move the cursor to the next desired location.
4. To define the Linefeed key, press c, type \n, then press Return.
5. Move the cursor to the next desired location.
6. To define the Backspace key, press c, type \b, then press Return.
7. To save your changes and exit kixkeydef, press w, then x. To exit without changing the key file, press x.
If you want to change a definition during the editing session, move the cursor to the field and type the new definition. You can also use the Undo (u) or Refresh (r) functions to edit a definition.
If you use the kixkeydef utility to modify a key file that contains comments, the comments are lost when you save the file.
CODE EXAMPLE 8-1 shows a key file generated by the kixkeydef utility.
If you want to create more than two definitions for a key, or you need to modify more than two definitions that were previously created, you must edit the key file directly instead of using the kixkeydef utility. For example, if you are going to define a new key file that supports the COBOL Animator debugger, you must be sure to define the four cursor/arrow keys.
The format of each entry in the key file is illustrated in the following example:
The definition starts in column 1. This entry defines the "Cursor up one position" key sequence. The \E represents the ESC character (0x1b in hexadecimal). The sequence of characters that defines the UP function in this example are ESC[A. You can use the special character sequences listed in the following table in the definitions.
You can assign a key more than one value. For example, you can define the LEFT key as both \b and \E[D.
You can add comment lines to the file if the line has a pound sign (#) in the first column.
The default file name that contains the terminal's key translations is constructed by using the name of the terminal in the TERM environment variable and appending the .key suffix. The key file must be in the directory $UNIKIX/lib or $UNIKIX/local/lib. The $UNIKIX/local/lib directory is searched first, followed by $UNIKIX/lib. As an alternative, you can use the -k parameter of the unikix command to specify a relative or absolute path name for the file.
The following table lists the keyboard mapping for TERM=xterms with an NCD 101-key keyboard. Appendix A lists the mappings for other supported keyboards.
The following table defines the 3270 keyboard functions.
X resource definitions for keysym translations in the invocation of the xterm terminal emulator tell the xterm VT100 terminal emulator running as the client the correct character sequences to generate for keys located in the application keypad. This is accomplished using the xterm -xrm parameter string.
The following are sample values for the X resources used with the NCD 101-key keyboard:
The names following <Key> are X keysym values and might not directly reflect the key's legend. An X utility called xev can determine the keysym generated by a key.
Shell scripts containing resource definitions for each supported X server and keyboard combination are located in the $UNIKIX/bin directory. Use these shell scripts to start individual user clients in a new window. For example:
The shell scripts whose names terminate with the suffix start (for example, ncd101start or xtermstart) provide a two-window program development environment. The start shell scripts call the shell scripts with names terminating with unikix. For more information, refer to the Sun Mainframe Transaction Processing Software Reference Guide.
Another level of configuration is available on X servers. This is the ability to map the scan code generated by the keyboard to an X keysym. Normally, this level of tailoring is not required. For more information, refer to the man page for xmodmap(1).
ASCII terminals are defined in the /etc/inittab file, which is read and acted on by the init process. The following is a sample entry in /etc/inittab:
The field none can contain a terminal type; however, the list of terminal types available to getty is limited. Use the tput init command, usually in the .profile or .login file, to initialize the terminal. Refer to the man page entry for inittab(4) for more information about the init process.
Copyright © 2004, Sun Microsystems, Inc. All rights reserved.