Consultor Eletrônico



Kbase 5832: How to debug terminal & protermcap set-up problems.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
How to debug terminal & protermcap set-up problems.

900531-pjh01
INTRODUCTION: Date Last Modified: 6/26/90
=============

This Product Service Technical Support Knowledgebase entry outlines a
method for modifying your PROTERMCAP file if it is not mapped exactly
to your terminal, or if you have a terminal that is not part of the
PROTERMCAP entries provided by PROGRESS SOFTWARE. It also describes
how to use vi (unix editor) to display the escape sequences sent by
the terminal's function keys.


WHY YOU'LL NEED TO DO THIS:
===========================

There are cases where the protermcap file is set up differently than
the terminal you are using,so you may need to make some minor
modifications to an existing PROTERMCAP entry.


PROCEDURAL APPROACH:
====================

Copy PROGRESS' default PROTERMCAP file from the directory where
PROGRESS was installed to your own working directory. (For example,
UNIX:> dlc/protermcap, VMS:> DLC:proterm.dat). Give it a new name so
that it is apparent that it is a customized file. Then change your
PROTERMCAP variable or logical to point to this customized file.

The basic format of a PROTERMCAP entry is:

:protermcap symbol=cod:

The colons on both sides of the entry delimit the entry, and the back
slash at the end indicates that there are more entries to follow. The
back slash follows every line in the terminal definition except the
last line. You can put as many entries on each line as you like.


The protermcap symbol tells PROGRESS what the entry is defining, and
the code is simply the definition. For example, the symbol GS is used
to define the code used to put a terminal in graphics mode so the
entry :GS=\EH^B:\ tells PROGRESS that sending ESC H Ctrl-B will put
the terminal in graphics mode.


Defining new keys for PROGRESS in your custom PROTERMCAP file is a
basic process. For each key you define, you need to indicate to
PROGRESS what function or action you are defining (GO, HELP,
INSERT-MODE,etc.). You need to also indicate the label on the key-
board of the key you're defining (F1, F2,F3, etc), and the character
sequence that it sends when you press the key. For more information
on functions and key labels, see the PROGRESS Programming Handbook.


Once you know the format for an entry in the PROTERMCAP file, you
need to find out what is sent when you define which key to press.
This information is in the terminal's documentation. If you do not
have the documentation handy, you can see what the key is sending by
performing the following steps:


1) Edit a new file -- vi 'any file name'

2) Press i for insert mode.

3) Press Ctrl-v and a ^ appears.

4) Press the key and see what character it sends.


An ESC character in the sequence is represented by a ^[. Even though
you can enter an ESC in a PROTERMCAP with ^[, it is better to enter it
as \E for readability. If the cursor in vi went to the next line when
the key was pressed, it is also sending a return at the end of the
escape sequence. This is represented in the termcap file as \r. When
representing control characters in the termcap file, they are entered
as a carat (^), followed by the character.


For example, you want to define the page-up and page-down keys for
your terminal in PROGRESS, and you have already found that in vi the
page-up key sends ^[J and the page-down key sends ^[K. You just need
to add the following lines to your custom PROTERMCAP file to define
these keys:


:PAGE-UP(PREV-PAGE)=\EJ: :PAGE-DOWN(NEXT-PAGE)=\EK:

As you make changes to your custom PROTERMCAP file, remember that your
best resource for help is the file itself. If you are not sure how to
define a key, look at the entries for other terminals and see how it
is done there. Usually, the only difference is the escape sequence.


ONLINE PROCEDURES OR UTILITIES:
===============================

None


REFERENCES TO WRITTEN DOCUMENTATION:
====================================

PROGRESS Programming Handbook - Chapter on The Keyboard, Monitor and
Character Set

Progress Software Technical Support Note # 5832