Highlighted
Absent Member.
Absent Member.
1294 views

[archive] Any Experts on using the a_termcap file?

[Migrated content. Thread originally posted on 28 September 2006]

We are using a telnet application (Wavelink telnet CE) on symbol wireless handhelds to access our application on a SCO UNIX server. All is working fine using this setup. However I am having a bit of difficulty getting the colors to work properly. I can only access 8 colors from the 16 color palette. Using Telnet from a windows workstation works fine, because most applications have an escape sequence to toggle the intensity.

The Wavelink Telenet CE application does not have an Escape sequence to turn off/on the intensity. Instead they provide 16 separate escape sequences for each color. 8 for low intensity and 8 for high intensity. This coupled with the fact that I can only use 8 colors (C1-C8) in the a_termcap file throws a bit of a wrench into things when our application is configurable to use all 16 colors?

Here is a snippet from the Wavelink Telnet CE software for reference.

Visual Character and Line Attributes Select Graphic Rendition ESC[Ps;Ps?m
Sets the visual character attributes where Ps represents a certain visual attribute:

Ps=0 All attributes off (Normal text)
Ps=1 Bold
Ps=2 Faint
Ps=3 Italicized
Ps=4 Underline
Ps=5 Blinking
Ps=7 Reverse video
Ps=8 Invisible (VT300)
Ps=9 Crossed-out
Ps=22 Bold and Faint off
Ps=23 Italicized off
Ps=24 Underline off
Ps=25 Blinking off
Ps=27 Reverse video off
Ps=28 Invisible off (VT300)
Ps=29 Crossed-out off
Ps=30 Set foreground color to Black
Ps=31 Set foreground color to Red
Ps=32 Set foreground color to Green
Ps=33 Set foreground color to Yellow
Ps=34 Set foreground color to Blue
Ps=35 Set foreground color to Magenta
Ps=36 Set foreground color to Cyan
Ps=37 Set foreground color to White
Ps=39 Set foreground color to Default (Green)
Ps=40 Set background color to Black
Ps=41 Set background color to Red
Ps=42 Set background color to Green
Ps=43 Set background color to Yellow
Ps=44 Set background color to Blue
Ps=45 Set background color to Magenta
Ps=46 Set background color to Cyan
Ps=47 Set background color to White
Ps=49 Set background color to Default (Black)
Ps=90 Set foreground color to Gray (Bright Black)
Ps=91 Set foreground color to Bright Red
Ps=92 Set foreground color to Bright Green
Ps=93 Set foreground color to Bright Yellow
Ps=94 Set foreground color to Bright Blue
Ps=95 Set foreground color to Bright Magenta
Ps=96 Set foreground color to Bright Cyan
Ps=97 Set foreground color to Bright White
Ps=100 Set background color to Gray (Bright Black)
Ps=101 Set background color to Bright Red
Ps=102 Set background color to Bright Green
Ps=103 Set background color to Bright Yellow
Ps=104 Set background color to Bright Blue
Ps=105 Set background color to Bright Magenta
Ps=106 Set background color to Bright Cyan
Ps=107 Set background color to Bright White

Not all devices support all attributes. Non-supported attributes are ignored.

And I currently have my a_termcap entry defined as follows:
:C1=\E[30m:C2=\E[34m:C3=\E[32m:C4=\E[36m:C5=\E[31m:\
:C6=\E[35m:C7=\E[33m:C8=\E[37m:AC:\
:HI=\E[0;1m:LO=\E[0m:\ ## this currently just gives me bold text when a color should be high intensity.
:B1=\E[40m:B2=\E[44m:B3=\E[42m:B4=\E[46m:\
:B5=\E[41m:B6=\E[45m:B7=\E[43m:B8=\E[47m:

As you can see I can either use the 8 low or 8 high intensity ESC sequences for the Foreground C1-C8 and Background B1-B8 in the a_termcap file.

We do store the colors that users want as preferences. And we do know if the colors saved are high or low. If we knew that the user had saved foreground color 1 to be bright black, then if there were some way to swap C1=E\[30m at runtime with C1=E\90m I could make it work, but I can?t figure out how to do that or if that is even possible at this point.

The trouble arises when a user has one color as a background and the bight version of the same color as the foreground then they cannot see it on the screen..

Any ideas at all that anyone might have to help me get all 16 colors would be much appreciated.

Thanks
0 Likes
7 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Any Experts on using the a_termcap file?

Have you looked at the COLOR_TABLE runtime configuration variable? It may do what you require.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Any Experts on using the a_termcap file?

Thanks mnabbs, I'm looking into it now and from the description of it, it 'appears' as though it might do what I want... I does mention that it's typically used when a character based application is moved to a GUI environment. I'll have to play with it for awhile and see what I can come up with...

Thanks again for the insight.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Any Experts on using the a_termcap file?

The COLOR_TABLE doesn't work for me. However I have decided to persue a different approach.

Does anyone know how to send Escape sequences directly to the Telnet client? There is very little documenation about this and from what I read Acu doesn't recomend this because you can get things into a state where the runtime doesn't know where it's at.

Although being able to send my own escape sequences directly to the telent client would be useful for other things as well. i.e. turning on/off scanners on wireless handheld devices, etc.

Thanks for any input
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Any Experts on using the a_termcap file?

Interesting. I would have thought it would just be a matter of defining the escape sequence in working storage and displaying it via the screen section but the runtime seems to perform som kind of filtering on it.

I'm pretty sure on a unix system you could write it to /dev/tty (system definition for your standard output), but I didn't go so far as to test that.

brad
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Any Experts on using the a_termcap file?

You might try your escape sequences using the console mode runtime. The regular windows runtime does some initializations where as the console runtime crun32.exe does not.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Any Experts on using the a_termcap file?

Thanks for the ideas guys. It is quite simple to send your own escape sequences to the client using the following:

DISPLAY X"1B" "your sequence here" UPON CONSOLE.

the X"1B" is Escape in hex and the UPON CONSOLE actually bypasses the Acu runtime's terminal manager (as Phayes pointed out).

Anyhow this works beautifully fow my purpose and since I have defined a separate entry in the a_termcap file for our handhelds I can do this only when the TERM-NAME is populated with my term type and nothing else is affected.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Any Experts on using the a_termcap file?

Hi there!

We've been outputting Escape Sequences for years for the proprietary touch terminals that we use.

There are a whole lot of methods that work to varying degrees.

You can change the setting of SCREEN_MANAGER_MODE to '2' at the start of your program, like this:

SET ENVIRONMENT "SCREEN-MANAGER-MODE" TO "2"

And then output the escape sequences with normal DISPLAYs. We tend to display the escape sequence at line 1 to make sure the terminal doesn't think it needs to scroll.

The CONTROL "PASS-THRU" phrase on each DISPLAY also helps to get the runtime to pass the escape sequence through without editing.

Another method is to use the DISPLAY ..... UPON SYSOUT or SYSOUT-FLUSH.

If you need any pointers, then send me a message.

Cheers.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.