FOCUS in the UNIX and Linux Environments

In this section:

This section describes how certain FOCUS facilities work in a UNIX or Linux environment.

Terminal Support

In this section:

FOCUS uses the information in the terminfo files to determine how to interact with full-screen terminals. The UNIX environmental variable TERM holds the name of the file that describes the particular terminal being used.

In order for FOCUS to interact correctly with a particular terminal, the name of the corresponding terminfo file must be assigned to the the UNIX variable TERM and the variable must be exported before you start FOCUS. Since this is a UNIX standard, these steps are usually included in the UNIX profile and are executed automatically when a user logs in. To display the current value of TERM, issue the following UNIX command before you start FOCUS:

echo $TERM

To verify that the value has been exported, issue the following command:

export

To assign a value or change the current value of TERM and export it, issue the following commands:

TERM=value
export TERM

where:

value

Identifies the type of terminal you are using.

Note: If operating system messages, line noise, or other undesired characters overlay your screen during a FOCUS session, press Ctrl+L to refresh the screen. If this solution does not work, see your system administrator.

Remapping Keys

FOCUS supports terminal remapping, which enables you to translate the signals that are being transmitted from and to the terminal into values that are more useful to FOCUS users. The files fockeys.err and focescs.err control the interpretation of keyboard input and screen output, respectively. Directions for changing the input or output map appear at the beginning of the respective file.

Function Key Support

FOCUS uses the UNIX terminfo files to determine how to interact with full-screen terminals. In some cases, the terminfo files supplied with UNIX may not adequately support function keys. Also, a terminal may not have as many function keys as FOCUS allows. If your terminal lacks proper function key support, you can address the problem in one of the following ways:

  • The system administrator can modify the UNIX terminfo files or the FOCUS fockeys.err file. Directions for changing fockeys.err appear at the beginning of the file.
  • You can use the following method to specify the desired function key. Press the Esc key followed by two numeric keys. You do not need to press the Enter key. For example, to specify function key 1, enter:
    ESCAPE 0 1

    Note that function keys 1 through 9 require a leading zero.

International 8-Bit Character Support

FOCUS supports 8-bit characters. The terminal and keyboard you use determine how to get the desired character. Some keyboards provide the character directly. Others require a sequence of keys.

To determine whether your system is stripping the 8th bit before transmitting keyboard input to FOCUS, issue the following UNIX command before you start FOCUS:

stty -a

Look for the values cs8 and -istrip in the output. (istrip means strip the bit; -istrip means do not strip the bit.) To set the desired values, issue the following command:

stty cs8 -istrip

You can add this command to your UNIX profile.

The Concatenation Symbol

The FOCUS string concatenation symbol is the same as the UNIX pipe symbol. It can appear as a broken vertical bar (¦) or an unbroken vertical bar (|) and translates to ASCII 124 (HEX 7C, OCTAL 174).

Running FOCUS as a Background Process

The UNIX commands at, batch, and &, as well as redirection facilities, enable you to batch a process or run it in background. You can use these commands and facilities with FOCUS only if no interaction with the terminal is required. In addition, you should set the following FOCUS parameters to OFF: MORE, SCREEN, and PAUSE.

The following procedure, called tabbat.fex shows how to prepare a TABLE request to be run as a background process:

SET MORE=OFF, SCREEN=OFF, PAUSE=OFF
TABLE FILE CAR
PRINT COUNTRY
ON TABLE HOLD AS CARBATCH
END
FIN

The following command shows how to start FOCUS with the -p option, run the above request, redirect system messages to a file, and use & to send the process to background:

focus -x "ex tabbat.fex" &

While the above example uses redirection and &, similar results can be achieved with the other UNIX facilities mentioned previously. For information on these UNIX facilities, see your operating system documentation.


Information Builders