Operating System - HP-UX
1820619 Members
1839 Online
109626 Solutions
New Discussion юеВ

rlogin and TERM type issues

 
Andy McDade
Advisor

rlogin and TERM type issues

I have a problem with the TERM type setting on a remote machine after rlogin.
On the local (I'm running putty) machine, ttytype reports "vt100", but "tset -" reports xterm. $TERM is set to xterm.
When I rlogin to the remote machine, both ttytype and tset - report "vt100".
According to the rlogin man page, the TERM type should be carried across to the remote, but it doesn't seem to go on tset or the $TERM var.

Any ideas?
Thanks
5 REPLIES 5
Mark Greene_1
Honored Contributor

Re: rlogin and TERM type issues

You can modify the /etc/profile on the target system (the one you are rloging to) and change where the TERM variable is being set by removing "-o "$TERM" = "network" and adding a seperate eif clause for that condition to set the TERM based on "tset -" and see if that makes a difference.

mark
the future will be a lot like now, only later
RAC_1
Honored Contributor

Re: rlogin and TERM type issues

The putty is setting the term to xterm. Check the puuty config. Check the cnnection. There is a option that says "Data to send to the server" In this by default the terminal tpe string is set to xterm. Cheanage that to vt100.

If you want xterm togo to remote term, do not set term through puuty, export the TERM explicitely after you login.

Anil
There is no substitute to HARDWORK
Andy McDade
Advisor

Re: rlogin and TERM type issues

Mark, I will give that a go, thanks.

RAC, I *want* the xterm variable carried across the rlogin session. I have xterm on local and want xterm on remote, but I end up with vt100 on remote
Muthukumar_5
Honored Contributor

Re: rlogin and TERM type issues

When we login then it will go via /etc/profile so that , the is a shell action as,

if [ "$TERM" = "" -o "$TERM" = "unknown" -o "$TERM" = "dialup" \
-o "$TERM" = "network" ]
then
eval `ttytype -s -a`
fi

export TERM

It will check $TERM information passed on putty there. If it is null or unknown or dialup then only it will make changes as,

by executing ttytype -s -a on shell there so that tset -s, ttytype, TERM variable are having informations there.

To avoid this,

1> Go to putty --> connection --> Terminal-type String to " " / unknown / dialup

or

2> Go to /etc/profile,


#if [ "$TERM" = "" -o "$TERM" = "unknown" -o "$TERM" = "dialup" \
-o "$TERM" = "network" ]
# then
eval `ttytype -s -a`
# fi

# export TERM

It will give what you expect now .. ( output are same now )

HTH.

REgards
Muthu.
Easy to suggest when don't know about the problem!
Bill Hassell
Honored Contributor

Re: rlogin and TERM type issues

Actually, the TERM variable should *always* be tested with ttytype. tset is very old and designed only for serial ports and real terminals, not LAN-based PCs with emulators. The default HP profiles will test to see if $TERM is already set prior to the profile, and bypass the ttytype test if set. That's bad. The reason is that telnet or rlogin protocols can carry a terminal ID string and the telnet daemon will preset TERM based on what your PC (or Mac or Linux, or...) has as a terminal ID.

Your PC has no clue about the terminfo database and putty or Reflection or NetTerm, etc do not have any idea how to match a local value with the models in the HP-UX terminfo database. The man page is written as to how HP-UX would behave with rlogin to another HP-UX box, not how your PC behaves. rlogin between 2 HP-UX systems will provide a correct setting for TERM without ttytype although I would still use ttytype to set the 3 variables: TERM COLUMNS LINES.

And you never want to force TERM=vt100 or TERM=xterm because you can't predict what the remote user actually has. TERM must be set to a value that matches the terminal emulator, and with many emulators, they can be configured to several emulations. Here's how ttytype works (from the man page):

1. send a Wyse ID string. Wait 1 second for a response. If a response is seen, use the details in the response to find the model number.

2. If Wyse ID fails, try an ANSI query to see if there is a response (ANSI includes DEC VT models, xterm, etc). If true then match the response internally and produce a model number.

3. If 1 and 2 fail, then try an HP terminal query and if OK, use a couple of other queries to identify exactly which model it is. Recent (less than 15 years old) terminals actually return their model number like 700/92.

When you run ttytype -s, a series of shell commands are echoed back. By using the eval command, these lines will set the current shell's TERM, COLUMNS and LINES which are then in turn used by vi, swinstall, sam, and other applications that use the Curses library.

HP's profiles should have all the: if [ TERM=.... ] statements removed and replaced with:

eval $(/sbin/ttytype -s)

Now TERM matches your emulator which is what it is supposed to do. Using whatever a foreign opsystem sends over will always be fraught with perils. Now there are good and bad emulators. A particular emulator may respond as if it is a vt100 but allows page scrolling and programmable softkeys. A VT100 has no such capability.

To see all the models that are in the HP database, use the command:

ls /usr/lib/terminfo/*

(there's about 1,800 entries) You also need to make sure that your rlogin actually runs /etc/profile and then $HOME/.profile or you'll get whatever telnetd or rlogind get from the remote system.


Bill Hassell, sysadmin