cancel
Showing results for 
Search instead for 
Did you mean: 

Terminal issue with Aries

cheesytime
Regular Advisor

Terminal issue with Aries

We have an application that was originally running on a 10.20 PA-RISC box and now is running on top of Aries, everything seems to be working weel but one thing... we ssh/telnet into this 11.31 box and navigate a menu with a vt100 terminal emulator, all the keys are working perfectly but the right arrow key which acts as an "ESCAPE"

What could be causing such behavior? The same thing works PERFECTLY on the 10.20 box. How can I check what string is the box receiving when I press the right key, and if it is receiving the right string what could be causing that particular behavior?

THanks
1 REPLY
Bill Hassell
Honored Contributor

Re: Terminal issue with Aries

> vt100 emulator...

Unfortunately, huge variations exist between all emulators (there are dozens). Start by comparing stty -a lists between the two systems. You'll need to find out from the emulator what is actually being sent by the right arrow key.

The Curses list of special codes is kept in the terminfo (/usr/lib/terminfo) directory structure and the man page for terminfo will describe the special names for each code. You then decode what Curses supports by using the command:

untic $TERM

The right arrow for TERM=vt100 is defined by kcuf1 which should be ESC O C (uppercase O and C). All the arrow keys (when enabled to transmit a code) send ESCAPE followed by two letters in a vt100 emulator. The terminal driver recognizes that all 3 characters are sent very quickly and there constitute a possible special sequence. See the man pages for stty, termio and termiox.

Special keys such as arrows and page up/down are not ASCII characters but are multi-character strings and a (small) handful of programs will attempt to handle them in some manner. For instance, vi will change the arrow keys from local (moves around screen but sends no text to the computer) to transmit and then the .exrc file will have macros to handle these special sequences. bash can handle some emulator arrow keys but ksh and POSIX shells leave the keys as local.

So while it seems that it should be simple, the reality is that anything that is not ASCII will have potential compatibility issues. A good debugging tool is the command:

echo 'some charcaters from your keyboard' | xd -xc

which decodes characters into hex and displayable values. Use the man page for ascii to find the hex codes.


Bill Hassell, sysadmin