Operating System - HP-UX
1832059 Members
3063 Online
110034 Solutions
New Discussion

Problem with ttytype and wyse terminal on AClass server

 
Stacey Akerstrom
Frequent Advisor

Problem with ttytype and wyse terminal on AClass server

Hello-
I have a wyse term attached to an A-Class, and am having problems getting it to work with certain homegrown apps (that are menu driven).
If I type 'eval $( ttytype -a -s ), I do not get a response.
I have the following line in /etc/ttytypes:
wyse50 tty2a1
and the terminal ID setting on the terminal itself is wyse50.
Any ideas as to how I can get this to work correctly?

Thanks-
Stacey
10 REPLIES 10
Steven E. Protter
Exalted Contributor

Re: Problem with ttytype and wyse terminal on AClass server

Try setting the term type to vt100 or hp

See if that works any bettter. It may seem counter intuitive, but it might.

SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Stacey Akerstrom
Frequent Advisor

Re: Problem with ttytype and wyse terminal on AClass server

The only 'compatible mode' options I'm seeing in the terminal settings are as follows:
ADDSVP
HZ1500
WY50
TVI910
TVI920
TVI925
I don't have a vt100 option.

Thanks-
Stacey
Mark Grant
Honored Contributor

Re: Problem with ttytype and wyse terminal on AClass server

You could cheat.

How about putting "[ `tty` = "/dev/tty2a1" ] && export TERM=wyse50" instead of teh "tty" command.
Never preceed any demonstration with anything more predictive than "watch this"
Stacey Akerstrom
Frequent Advisor

Re: Problem with ttytype and wyse terminal on AClass server

Where would I put "[ `tty` = "/dev/tty2a1" ] && export TERM=wyse50"?

Thanks-
Stacey
Mark Grant
Honored Contributor

Re: Problem with ttytype and wyse terminal on AClass server

Well, you could put it in the users ".profile" or in /etc/profile for system wide. However, it will only work if you log on to a terminal attached to /dev/tty2a1. If all terminals are wyse 50 terminals, then you only need to put "export TERM=wyse50" in /etc/profile.
Never preceed any demonstration with anything more predictive than "watch this"
Stacey Akerstrom
Frequent Advisor

Re: Problem with ttytype and wyse terminal on AClass server

I've added export TERM=wyse50 to /etc/profile, however, some of my screens are still messed up. Cursor doesn't appear in correct field, etc...
Mark Grant
Honored Contributor

Re: Problem with ttytype and wyse terminal on AClass server

Ok Stacey,

are you saying some terminals work correctl now? If so, there will be some difference in the set up of the ones that don't work. Failing that, I think you need to do a bit more investigating. See if the users with a problem still have a problem if they try one of the working screens. If they do, then their TERM is being overwritten either in their personal .profile or somewhere in the chain between logging in and running the app.

If still no luck, check your homegrown apps, you need to find out if they use termcap or terminfo. Also, what they use for cursor positioning. Do they use the "curses" routines. The definition for each terminal is held in /etc/termcap or the termcap database depending on how they were linked at compile time. These files (/etc/termcap you can just have a look at, whereas termcap you need to "decompile" with "untic") describe the sequences to control the terminal. Make sure that a) the entry for wyse50 is correct (probably is) and make sure that the application is using them correctly. If using "curses" this isn't an issue.

Hope that give syou some more to be going on with!
Never preceed any demonstration with anything more predictive than "watch this"
Bill Hassell
Honored Contributor

Re: Problem with ttytype and wyse terminal on AClass server

The /etc/ttytype (note: singular spelling) file is used to hardcode the TERM value ofr login and tset. The man page is man 4 ttytype. This mechanism is a real kludge, sort of a bandaid for truly dumb terminals. Note that login and tset will quietly ignore /etc/ttytypes since it is misspelled.

Set the terminal to WY50 mode. No amount of playing with TERM settings will work right until you match TERM with the type of terminal you have. The other settings correspond to ADDS, TVI and Hazeltine terminals. These are truly pre-historic terminals so the first problem is to pick an emulation that actually has an answer-back capability. Don't bother using the eval $(ttytype -s) command until ttytype -s works by itself. You'll have to look inside the terminal settings for any automated response settings so that ttytype will actually work. If ttytype gets no response then the terminal is not replying to a standard Wyse query.

Now it's important that your homegrown apps use the Curses library (scripts use tput for terminal control). If not, then it is very likely the scripts were hardcoded for a particular terminal (very bad design), the very reason that Curses was written. In that case, the value of TERM is meaningless and you'll have to either scrap all your terminals and buy new ones that match the hardcoded sequences, or rewrite the code to use Curses (and get the terminals to reply to a status inquiry.

Now once you get an emulation that replies back (or are stuck with using /etc/ttytype), if a particular screen is messed up, you'll have to track down the code and see if it is a hardcoded escape sequence, or it is a valid Curses capability, in which case, the terminal apparently does not understand the codes. Use tput to test the Curses code as in:

tput clear | xd -xc

where clear is the capname used in the Curses library call.


Bill Hassell, sysadmin
Stacey Akerstrom
Frequent Advisor

Re: Problem with ttytype and wyse terminal on AClass server

I am currently only working with one terminal.
I'm really starting to think that you may be right in that something is hardcoded in the programs.
We've run into this in the past when we were trying to get our serial devices functioning.
As far as I can tell, my terminal settings (and yes, that /etc/ttytypes was *my* typo) appear to be correct, so I'm going to start looking to see where and how terminfo and termcap are being referenced.
Thanks guys-
Stacey
Bill Hassell
Honored Contributor

Re: Problem with ttytype and wyse terminal on AClass server

Note that termcap and $TERM may not be referenced at all in the program. If it uses Curses, then you'll find many of the functions referenced in man 5 curses documentation. The Curses routines (libcurses) are the ones that pay attention to the $TERM value.


Bill Hassell, sysadmin